72 references to AllowedMemberLocations
System.Xaml (22)
System\Xaml\Context\XamlContext.cs (2)
193if ((directive.AllowedLocation & AllowedMemberLocations.Attribute) == AllowedMemberLocations.None)
System\Xaml\Schema\XamlDirective.cs (5)
16private AllowedMemberLocations _allowedLocation; 19internal XamlDirective(ReadOnlyCollection<string> immutableXamlNamespaces, string name, AllowedMemberLocations allowedLocation, MemberReflector reflector) 34XamlValueConverter<TypeConverter> typeConverter, AllowedMemberLocations allowedLocation) 59_allowedLocation = AllowedMemberLocations.Any; 62public AllowedMemberLocations AllowedLocation { get { return _allowedLocation; } }
System\Xaml\XamlLanguage.cs (15)
125String, BuiltInValueConverter.Int32, AllowedMemberLocations.Attribute), true); 128s_listOfObject.Value, null, AllowedMemberLocations.Any), true); 137s_string.Value, BuiltInValueConverter.Int32, AllowedMemberLocations.Any), true); 140s_string.Value, BuiltInValueConverter.String, AllowedMemberLocations.Any), true); 145s_listOfObject.Value, null, AllowedMemberLocations.Any), true); 148s_object.Value, null, AllowedMemberLocations.Any), true); 151s_object.Value, BuiltInValueConverter.String, AllowedMemberLocations.Any), true); 154s_listOfMembers.Value, null, AllowedMemberLocations.MemberElement), true); 157s_listOfAttributes.Value, null, AllowedMemberLocations.MemberElement), true); 162s_listOfObject.Value, null, AllowedMemberLocations.Any), true); 174new Lazy<XamlDirective>(() => GetXamlDirective(x_UnknownContent, AllowedMemberLocations.MemberElement, MemberReflector.UnknownReflector), true); 444return GetXamlDirective(name, String, BuiltInValueConverter.String, AllowedMemberLocations.Attribute); 447private static XamlDirective GetXamlDirective(string name, AllowedMemberLocations allowedLocation, MemberReflector reflector) 454XamlValueConverter<TypeConverter> typeConverter, AllowedMemberLocations allowedLocation) 462XamlDirective result = new XamlDirective(s_xmlNamespaces, name, AllowedMemberLocations.Attribute, new MemberReflector(String, BuiltInValueConverter.String));
System.Xaml.Tests (50)
System\Xaml\XamlDirectiveTests.cs (26)
19yield return new object?[] { new string[] { "xamlNamespace" }, "name", null, AllowedMemberLocations.Any }; 20yield return new object?[] { new string[] { ""} , "", new XamlValueConverter<TypeConverter>(typeof(int), type), AllowedMemberLocations.None }; 21yield return new object?[] { new string[] { ""} , "", new XamlValueConverter<TypeConverter>(typeof(int), type), AllowedMemberLocations.None }; 22yield return new object?[] { Array.Empty<string>(), "name", null, AllowedMemberLocations.None - 1 }; 27public void Ctor_Strings_String_XamlType_XamlValueConverter_AllowedMembersLocation(IEnumerable<string> xamlNamespaces, string name, XamlValueConverter<TypeConverter> typeConverter, AllowedMemberLocations 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)); 69Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 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 }; 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" }; 250var converter = new SubXamlDirective(Array.Empty<string>(), "name", type, typeConverter, AllowedMemberLocations.Any); 258var converter = new SubXamlDirective(Array.Empty<string>(), "name", type, null!, AllowedMemberLocations.Any); 287public SubXamlDirective(IEnumerable<string> xamlNamespaces, string name, XamlType xamlType, XamlValueConverter<TypeConverter> typeConverter, AllowedMemberLocations allowedLocation) : base(xamlNamespaces, name, xamlType, typeConverter, allowedLocation) { }
System\Xaml\XamlLanguageTests.cs (24)
276Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 289Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 302Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 315Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 328Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 341Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 354Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 367Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 380Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 393Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 406Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 419Assert.Equal(AllowedMemberLocations.MemberElement, directive.AllowedLocation); 432Assert.Equal(AllowedMemberLocations.MemberElement, directive.AllowedLocation); 445Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 458Assert.Equal(AllowedMemberLocations.Any, directive.AllowedLocation); 471Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 484Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 497Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 510Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 523Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 536Assert.Equal(AllowedMemberLocations.MemberElement, directive.AllowedLocation); 549Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 562Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation); 575Assert.Equal(AllowedMemberLocations.Attribute, directive.AllowedLocation);