3 namespace Tizen.NUI.Xaml
5 internal static class XmlnsHelper
7 public static string ParseNamespaceFromXmlns(string xmlns)
13 ParseXmlns(xmlns, out typeName, out ns, out asm);
17 public static void ParseXmlns(string xmlns, out string typeName, out string ns, out string asm)
19 typeName = ns = asm = null;
23 if (xmlns.StartsWith("using:", StringComparison.Ordinal))
25 ParseUsing(xmlns, out typeName, out ns, out asm);
28 ParseClrNamespace(xmlns, out typeName, out ns, out asm);
31 static void ParseClrNamespace(string xmlns, out string typeName, out string ns, out string asm)
33 typeName = ns = asm = null;
35 foreach (var decl in xmlns.Split(';'))
37 if (decl.StartsWith("clr-namespace:", StringComparison.Ordinal))
39 ns = decl.Substring(14, decl.Length - 14);
43 if (decl.StartsWith("assembly=", StringComparison.Ordinal))
45 asm = decl.Substring(9, decl.Length - 9);
49 var nsind = decl.LastIndexOf(".", StringComparison.Ordinal);
52 ns = decl.Substring(0, nsind);
53 typeName = decl.Substring(nsind + 1, decl.Length - nsind - 1);
60 static void ParseUsing(string xmlns, out string typeName, out string ns, out string asm)
62 typeName = ns = asm = null;
64 foreach (var decl in xmlns.Split(';'))
66 if (decl.StartsWith("using:", StringComparison.Ordinal))
68 ns = decl.Substring(6, decl.Length - 6);