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)) {
24 ParseUsing(xmlns, out typeName, out ns, out asm);
27 ParseClrNamespace(xmlns, out typeName, out ns, out asm);
30 static void ParseClrNamespace(string xmlns, out string typeName, out string ns, out string asm)
32 typeName = ns = asm = null;
34 foreach (var decl in xmlns.Split(';'))
36 if (decl.StartsWith("clr-namespace:", StringComparison.Ordinal))
38 ns = decl.Substring(14, decl.Length - 14);
42 if (decl.StartsWith("assembly=", StringComparison.Ordinal))
44 asm = decl.Substring(9, decl.Length - 9);
48 var nsind = decl.LastIndexOf(".", StringComparison.Ordinal);
51 ns = decl.Substring(0, nsind);
52 typeName = decl.Substring(nsind + 1, decl.Length - nsind - 1);
59 static void ParseUsing(string xmlns, out string typeName, out string ns, out string asm)
61 typeName = ns = asm = null;
63 foreach (var decl in xmlns.Split(';')) {
64 if (decl.StartsWith("using:", StringComparison.Ordinal)) {
65 ns = decl.Substring(6, decl.Length - 6);