1 type derived from XamlDirective
System.Xaml.Tests (1)
System\Xaml\XamlDirectiveTests.cs (1)
283public class SubXamlDirective : XamlDirective
47 instantiations of XamlDirective
PresentationFramework (1)
System\Windows\Markup\XamlReaderConstants.cs (1)
69_freezeDirective = new System.Xaml.XamlDirective(XamlReaderHelper.PresentationOptionsNamespaceURI, XamlReaderHelper.PresentationOptionsFreeze);
System.Xaml (5)
System\Xaml\Context\XamlContext.cs (2)
197directive = new XamlDirective(propUsageNamespace, propName.Name); 214property = new XamlDirective(propUsageNamespace, propName.Name);
System\Xaml\XamlLanguage.cs (3)
449XamlDirective result = new XamlDirective(s_xamlNamespaces, name, allowedLocation, reflector); 456XamlDirective result = new XamlDirective(s_xamlNamespaces, name, allowedLocation, new MemberReflector(xamlType, typeConverter)); 462XamlDirective result = new XamlDirective(s_xmlNamespaces, name, AllowedMemberLocations.Attribute, new MemberReflector(String, BuiltInValueConverter.String));
System.Xaml.Tests (41)
System\Xaml\XamlDirectiveTests.cs (25)
30var directive = new XamlDirective(xamlNamespaces, name, type, typeConverter, allowedLocation); 42Assert.Throws<ArgumentNullException>("xamlType", () => new XamlDirective(new string[] { "namespace"}, "name", null, null, AllowedMemberLocations.Any)); 49Assert.Throws<ArgumentNullException>("xamlNamespaces", () => new XamlDirective(null, "name", type, null, AllowedMemberLocations.Any)); 56Assert.Throws<ArgumentException>("xamlNamespaces", () => new XamlDirective(new string?[] { null }, "name", type, null, AllowedMemberLocations.Any)); 65var directive = new XamlDirective(xamlNamespace, name); 76Assert.Throws<ArgumentNullException>("xamlNamespace", () => new XamlDirective(null, "name")); 83var directive = new XamlDirective(new string[] { "namespace"}, "name", type, null, AllowedMemberLocations.Any); 91var directive = new XamlDirective(new string[] { "namespace"}, "name", type, null, AllowedMemberLocations.Any); 99var directive = new XamlDirective(new string[] { "xamlNamespace" }, "name", type1, null, AllowedMemberLocations.Any); 101yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, "name", type1, null, AllowedMemberLocations.Any), true }; 102yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, "name", type1, null, AllowedMemberLocations.None), true }; 103yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, "name", type1, new XamlValueConverter<TypeConverter>(typeof(int), type1), AllowedMemberLocations.None), true }; 104yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, "name", type2, null, AllowedMemberLocations.Any), true }; 105yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespaces" }, "name", type1, null, AllowedMemberLocations.Any), false }; 106yield return new object?[] { directive, new XamlDirective(Array.Empty<string>(), "name", type1, null, AllowedMemberLocations.Any), false }; 107yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace", "2" }, "name", type1, null, AllowedMemberLocations.Any), false }; 108yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, "name2", type1, null, AllowedMemberLocations.Any), false }; 109yield return new object?[] { directive, new XamlDirective(new string[] { "xamlNamespace" }, null, type1, null, AllowedMemberLocations.Any), false }; 111yield return new object?[] { new XamlDirective("xamlNamespace", null), new XamlDirective("xamlNamespace", null), true }; 112yield return new object?[] { new XamlDirective("xamlNamespace", null), new XamlDirective("xamlNamespace", "name"), false }; 143var directive = new XamlDirective("xamlNamespace", name); 150yield return new object[] { new XamlDirective(Array.Empty<string>(), "name", type, null, AllowedMemberLocations.Any), "name" }; 151yield return new object[] { new XamlDirective(new string[] { "1", "2" }, "name", type, null, AllowedMemberLocations.Any), "{1}name" };
System\Xaml\XamlMemberTests.cs (15)
631var directive = new XamlDirective("namespace", "name"); 731var directive = new XamlDirective("namespace", "name"); 793var directive = new XamlDirective("namespace", "name"); 957var directive = new XamlDirective("namespace", "name"); 1034var directive = new XamlDirective("namespace", "name"); 1094var directive = new XamlDirective("namespace", "name"); 1199var directive = new XamlDirective("namespace", "name"); 1276var directive = new XamlDirective("namespace", "name"); 1349var directive = new XamlDirective("namespace", "name"); 1473var directive = new XamlDirective("namespace", "name"); 1595var directive = new XamlDirective("namespace", "name"); 1681var directive = new XamlDirective("namespace", "name"); 1763var directive = new XamlDirective("namespace", "name"); 1963var directive = new XamlDirective("namespace", "name"); 2114var directive = new XamlDirective("namespace", "name");
System\Xaml\XamlTypeTests.cs (1)
582new XamlDirective("namespace", "name"),
167 references to XamlDirective
PresentationFramework (6)
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
32public override XamlDirective GetXamlDirective(string xamlNamespace, string name)
System\Windows\Markup\Baml2006\WpfKnownType.cs (1)
118protected override XamlMember LookupAliasedProperty(XamlDirective directive)
System\Windows\Markup\RestrictiveXamlXmlReader.cs (2)
106(NodeType == System.Xaml.XamlNodeType.StartMember && Member is XamlDirective directive && !IsAllowedDirective(directive))) 139private bool IsAllowedDirective(XamlDirective directive)
System\Windows\Markup\XamlReaderConstants.cs (2)
63internal static System.Xaml.XamlDirective Freeze 75private static System.Xaml.XamlDirective _freezeDirective;
System.Xaml (103)
System\Xaml\Context\XamlContext.cs (1)
190XamlDirective directive = SchemaContext.GetXamlDirective(propUsageNamespace, propName.Name);
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1626XamlMember propertyForDirective = xamlType.GetAliasedProperty(prop as XamlDirective);
System\Xaml\Parser\XamlPullParser.cs (1)
910var initProperty = XamlLanguage.Initialization;
System\Xaml\Schema\TypeReflector.cs (4)
41private ConcurrentDictionary<XamlDirective, XamlMember> _aliasedProperties; 319internal bool TryGetAliasedProperty(XamlDirective directive, out XamlMember member) 356internal void TryAddAliasedProperty(XamlDirective directive, XamlMember member) 379var dict = XamlSchemaContext.CreateDictionary<XamlDirective, XamlMember>();
System\Xaml\Schema\XamlDirective.cs (2)
98internal static bool NamespacesAreEqual(XamlDirective directive1, XamlDirective directive2)
System\Xaml\XamlLanguage.cs (88)
123private static Lazy<XamlDirective> s_asyncRecords = 124new Lazy<XamlDirective>(() => GetXamlDirective(x_AsyncRecords, 126private static Lazy<XamlDirective> s_arguments = 127new Lazy<XamlDirective>(() => GetXamlDirective(x_Arguments, 129private static Lazy<XamlDirective> s_class = 130new Lazy<XamlDirective>(() => GetXamlDirective(x_Class)); 131private static Lazy<XamlDirective> s_classModifier = 132new Lazy<XamlDirective>(() => GetXamlDirective(x_ClassModifier)); 133private static Lazy<XamlDirective> s_code = 134new Lazy<XamlDirective>(() => GetXamlDirective(x_Code)); 135private static Lazy<XamlDirective> s_connectionId = 136new Lazy<XamlDirective>(() => GetXamlDirective(x_ConnectionId, 138private static Lazy<XamlDirective> s_factoryMethod = 139new Lazy<XamlDirective>(() => GetXamlDirective(x_FactoryMethod, 141private static Lazy<XamlDirective> s_fieldModifier = 142new Lazy<XamlDirective>(() => GetXamlDirective(x_FieldModifier)); 143private static Lazy<XamlDirective> s_items = 144new Lazy<XamlDirective>(() => GetXamlDirective(x_Items, 146private static Lazy<XamlDirective> s_initialization = 147new Lazy<XamlDirective>(() => GetXamlDirective(x_Initialization, 149private static Lazy<XamlDirective> s_key = 150new Lazy<XamlDirective>(() => GetXamlDirective(x_Key, 152private static Lazy<XamlDirective> s_members = 153new Lazy<XamlDirective>(() => GetXamlDirective(x_Members, 155private static Lazy<XamlDirective> s_classAttributes = 156new Lazy<XamlDirective>(() => GetXamlDirective(x_ClassAttributes, 158private static Lazy<XamlDirective> s_name = 159new Lazy<XamlDirective>(() => GetXamlDirective(x_Name)); 160private static Lazy<XamlDirective> s_positionalParameters = 161new Lazy<XamlDirective>(() => GetXamlDirective(x_PositionalParameters, 163private static Lazy<XamlDirective> s_shared = 164new Lazy<XamlDirective>(() => GetXamlDirective(x_Shared), true); 165private static Lazy<XamlDirective> s_subclass = 166new Lazy<XamlDirective>(() => GetXamlDirective(x_Subclass), true); 167private static Lazy<XamlDirective> s_synchronousMode = 168new Lazy<XamlDirective>(() => GetXamlDirective(x_SynchronousMode)); 169private static Lazy<XamlDirective> s_typeArguments = 170new Lazy<XamlDirective>(() => GetXamlDirective(x_TypeArguments)); 171private static Lazy<XamlDirective> s_uid = 172new Lazy<XamlDirective>(() => GetXamlDirective(x_Uid)); 173private static Lazy<XamlDirective> s_unknownContent = 174new Lazy<XamlDirective>(() => GetXamlDirective(x_UnknownContent, AllowedMemberLocations.MemberElement, MemberReflector.UnknownReflector), true); 176private static Lazy<XamlDirective> s_base = 177new Lazy<XamlDirective>(() => GetXmlDirective(xml_Base)); 178private static Lazy<XamlDirective> s_lang = 179new Lazy<XamlDirective>(() => GetXmlDirective(xml_Lang)); 180private static Lazy<XamlDirective> s_space = 181new Lazy<XamlDirective>(() => GetXmlDirective(xml_Space)); 183private static Lazy<ReadOnlyCollection<XamlDirective>> s_allDirectives = 184new Lazy<ReadOnlyCollection<XamlDirective>>(GetAllDirectives); 214public static XamlDirective Arguments { get { return s_arguments.Value; } } 215public static XamlDirective AsyncRecords { get { return s_asyncRecords.Value; } } 216public static XamlDirective Class { get { return s_class.Value; } } 217public static XamlDirective ClassModifier { get { return s_classModifier.Value; } } 218public static XamlDirective Code { get { return s_code.Value; } } 219public static XamlDirective ConnectionId { get { return s_connectionId.Value; } } 220public static XamlDirective FactoryMethod { get { return s_factoryMethod.Value; } } 221public static XamlDirective FieldModifier { get { return s_fieldModifier.Value; } } 222public static XamlDirective Items { get { return s_items.Value; } } 223public static XamlDirective Initialization { get { return s_initialization.Value; } } 224public static XamlDirective Key { get { return s_key.Value; } } 225public static XamlDirective Members { get { return s_members.Value; } } 226public static XamlDirective ClassAttributes { get { return s_classAttributes.Value; } } 227public static XamlDirective Name { get { return s_name.Value; } } 228public static XamlDirective PositionalParameters { get { return s_positionalParameters.Value; } } 229public static XamlDirective Shared { get { return s_shared.Value; } } 230public static XamlDirective Subclass { get { return s_subclass.Value; } } 231public static XamlDirective SynchronousMode { get { return s_synchronousMode.Value; } } 232public static XamlDirective TypeArguments { get { return s_typeArguments.Value; } } 233public static XamlDirective Uid { get { return s_uid.Value; } } 234public static XamlDirective UnknownContent { get { return s_unknownContent.Value; } } 236public static XamlDirective Base { get { return s_base.Value; } } 237public static XamlDirective Lang { get { return s_lang.Value; } } 239public static XamlDirective Space { get { return s_space.Value; } } 241public static ReadOnlyCollection<XamlDirective> AllDirectives { get { return s_allDirectives.Value; } } 264internal static XamlDirective LookupXamlDirective(string name) 397internal static XamlDirective LookupXmlDirective(string name) 418private static ReadOnlyCollection<XamlDirective> GetAllDirectives() 420XamlDirective[] result = new XamlDirective[] 426return new ReadOnlyCollection<XamlDirective>(result); 442private static XamlDirective GetXamlDirective(string name) 447private static XamlDirective GetXamlDirective(string name, AllowedMemberLocations allowedLocation, MemberReflector reflector) 449XamlDirective result = new XamlDirective(s_xamlNamespaces, name, allowedLocation, reflector); 453private static XamlDirective GetXamlDirective(string name, XamlType xamlType, 456XamlDirective result = new XamlDirective(s_xamlNamespaces, name, allowedLocation, new MemberReflector(xamlType, typeConverter)); 460private static XamlDirective GetXmlDirective(string name) 462XamlDirective result = new XamlDirective(s_xmlNamespaces, name, AllowedMemberLocations.Attribute, new MemberReflector(String, BuiltInValueConverter.String));
System\Xaml\XamlMember.cs (3)
1076return XamlDirective.NamespacesAreEqual((XamlDirective)xamlMember1, (XamlDirective)xamlMember2);
System\Xaml\XamlSchemaContext.cs (1)
258public virtual XamlDirective GetXamlDirective(string xamlNamespace, string name)
System\Xaml\XamlType.cs (2)
383public XamlMember GetAliasedProperty(XamlDirective directive) 679protected virtual XamlMember LookupAliasedProperty(XamlDirective directive)
System.Xaml.Tests (58)
Common\CustomXamlType.cs (1)
22protected override XamlMember LookupAliasedProperty(XamlDirective directive)
Common\SubXamlType.cs (1)
21public XamlMember LookupAliasedPropertyEntry(XamlDirective directive) => LookupAliasedProperty(directive);
System\Xaml\XamlDirectiveTests.cs (10)
30var directive = new XamlDirective(xamlNamespaces, name, type, typeConverter, allowedLocation); 65var directive = new XamlDirective(xamlNamespace, name); 83var directive = new XamlDirective(new string[] { "namespace"}, "name", type, null, AllowedMemberLocations.Any); 91var directive = new XamlDirective(new string[] { "namespace"}, "name", type, null, AllowedMemberLocations.Any); 99var directive = new XamlDirective(new string[] { "xamlNamespace" }, "name", type1, null, AllowedMemberLocations.Any); 119public void Equals_Invoke_ReturnsExpected(XamlDirective directive, object obj, bool expected) 121XamlDirective? other = obj as XamlDirective; 143var directive = new XamlDirective("xamlNamespace", name); 156public void ToString_Invoke_ReturnsExpected(XamlDirective directive, string expected)
System\Xaml\XamlLanguageTests.cs (26)
270XamlDirective directive = XamlLanguage.Arguments; 283XamlDirective directive = XamlLanguage.AsyncRecords; 296XamlDirective directive = XamlLanguage.Class; 309XamlDirective directive = XamlLanguage.ClassModifier; 322XamlDirective directive = XamlLanguage.Code; 335XamlDirective directive = XamlLanguage.ConnectionId; 348XamlDirective directive = XamlLanguage.FactoryMethod; 361XamlDirective directive = XamlLanguage.FieldModifier; 374XamlDirective directive = XamlLanguage.Items; 387XamlDirective directive = XamlLanguage.Initialization; 400XamlDirective directive = XamlLanguage.Key; 413XamlDirective directive = XamlLanguage.Members; 426XamlDirective directive = XamlLanguage.ClassAttributes; 439XamlDirective directive = XamlLanguage.Name; 452XamlDirective directive = XamlLanguage.PositionalParameters; 465XamlDirective directive = XamlLanguage.Shared; 478XamlDirective directive = XamlLanguage.Subclass; 491XamlDirective directive = XamlLanguage.SynchronousMode; 504XamlDirective directive = XamlLanguage.TypeArguments; 517XamlDirective directive = XamlLanguage.Uid; 530XamlDirective directive = XamlLanguage.UnknownContent; 543XamlDirective directive = XamlLanguage.Base; 556XamlDirective directive = XamlLanguage.Lang; 569XamlDirective directive = XamlLanguage.Space; 582ReadOnlyCollection<XamlDirective> directives = XamlLanguage.AllDirectives; 584Assert.Equal(new XamlDirective[] { XamlLanguage.Arguments, XamlLanguage.AsyncRecords, XamlLanguage.Class, XamlLanguage.Code, XamlLanguage.ClassModifier, XamlLanguage.ConnectionId, XamlLanguage.FactoryMethod, XamlLanguage.FieldModifier, XamlLanguage.Key, XamlLanguage.Initialization, XamlLanguage.Items, XamlLanguage.Members, XamlLanguage.ClassAttributes, XamlLanguage.Name, XamlLanguage.PositionalParameters, XamlLanguage.Shared, XamlLanguage.Subclass, XamlLanguage. SynchronousMode, XamlLanguage.TypeArguments, XamlLanguage.Uid, XamlLanguage.UnknownContent, XamlLanguage.Base, XamlLanguage.Lang, XamlLanguage.Space }, directives);
System\Xaml\XamlMemberTests.cs (15)
631var directive = new XamlDirective("namespace", "name"); 731var directive = new XamlDirective("namespace", "name"); 793var directive = new XamlDirective("namespace", "name"); 957var directive = new XamlDirective("namespace", "name"); 1034var directive = new XamlDirective("namespace", "name"); 1094var directive = new XamlDirective("namespace", "name"); 1199var directive = new XamlDirective("namespace", "name"); 1276var directive = new XamlDirective("namespace", "name"); 1349var directive = new XamlDirective("namespace", "name"); 1473var directive = new XamlDirective("namespace", "name"); 1595var directive = new XamlDirective("namespace", "name"); 1681var directive = new XamlDirective("namespace", "name"); 1763var directive = new XamlDirective("namespace", "name"); 1963var directive = new XamlDirective("namespace", "name"); 2114var directive = new XamlDirective("namespace", "name");
System\Xaml\XamlSchemaContextTests.cs (1)
434public void GetXamlDirective_Invoke_ReturnsExpected(string xamlNamespace, string name, XamlDirective expected)
System\Xaml\XamlTypeTests.cs (4)
610public void LookupAliasedProperty_Type_ReturnsExpected(SubXamlType type, XamlDirective directive, XamlMember expected) 636public void LookupAliasedProperty_NullAttributeResult_ThrowsNullReferenceException(XamlDirective directive) 651public void LookupAliasedProperty_NullItemInAttributeResult_ThrowsNullReferenceException(XamlDirective directive) 666public void LookupAliasedProperty_InvalidTypeItemInAttributeResult_ThrowsInvalidCastException(XamlDirective directive)