Esempio n. 1
0
        private static XamlMember GetDirective(XamlMemberBase directive, XamlSchemaContext context)
        {
            var directiveName = TranslateDirectiveName(directive);

            var xamlMember = from ns in context.GetAllXamlNamespaces()
                let dir = context.GetXamlDirective(ns, directiveName)
                where dir != null
                select dir;

            return new DirectiveAdapter(xamlMember.First());
        }
Esempio n. 2
0
		public void GetAllXamlNamespaces ()
		{
			var ctx = new XamlSchemaContext (null, null);
			var arr = ctx.GetAllXamlNamespaces ().ToArray ();
			Assert.AreEqual (5, arr.Length, "#1");
			Assert.IsTrue (arr.Contains (XamlLanguage.Xaml2006Namespace), "#1-2");
			Assert.IsTrue (arr.Contains ("urn:mono-test"), "#1-3");
			Assert.IsTrue (arr.Contains ("urn:mono-test2"), "#1-4");

			ctx = NewStandardContext ();
			arr = ctx.GetAllXamlNamespaces ().ToArray ();
			Assert.AreEqual (1, arr.Length, "#2");
			Assert.AreEqual (XamlLanguage.Xaml2006Namespace, arr [0], "#2-2");

			ctx = NewThisAssemblyContext ();
			arr = ctx.GetAllXamlNamespaces ().ToArray ();
			Assert.AreEqual (4, arr.Length, "#3");
			Assert.IsTrue (arr.Contains ("urn:mono-test"), "#3-2");
			Assert.IsTrue (arr.Contains ("urn:mono-test2"), "#3-3");
		}