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