240 references to UnderlyingType
PresentationFramework (84)
System\Windows\Controls\ItemsPresenter.cs (1)
317type = xType.UnderlyingType;
System\Windows\FrameworkTemplate.cs (1)
575if (typeof(ResourceDictionary).IsAssignableFrom(type.UnderlyingType))
System\Windows\Markup\Baml2006\Baml2006Reader.cs (18)
881optimizedStaticResource.KeyValue = xamlType.UnderlyingType; 1062!_context.CurrentFrame.Member.Type.UnderlyingType.IsAssignableFrom(typeof(String))) 1090_xamlNodesWriter.WriteValue(BamlSchemaContext.GetXamlType(typeId).UnderlyingType); 1372if (_context.CurrentFrame.XamlType.UnderlyingType == typeof(EventSetter)) 1377Type currentType = eventProperty.DeclaringType.UnderlyingType; 1387eventProperty.DeclaringType.UnderlyingType); 1531converter = new EnumConverter(_context.CurrentFrame.XamlType.UnderlyingType); 1549Type type = BamlSchemaContext.GetXamlType(_binaryReader.ReadInt16()).UnderlyingType; 1589Type propertyType = property.Type.UnderlyingType; 1682param = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1698param = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1793typeExtensionType = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1829value = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1864_xamlNodesWriter.WriteValue(type.UnderlyingType); 1943_xamlNodesWriter.WriteValue(xamlType.UnderlyingType); 2513return Enum.ToObject(type.UnderlyingType, bytes).ToString(); 2587Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty)); 2666memberType = BamlSchemaContext.GetPropertyDeclaringType(valueId).UnderlyingType;
System\Windows\Markup\Baml2006\Baml2006ReaderInternal.cs (1)
48property.DeclaringType.UnderlyingType == typeof(System.Windows.ResourceDictionary) &&
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
151return xamlType.UnderlyingType;
System\Windows\Markup\Baml2006\WpfKnownType.cs (3)
359return UnderlyingType.GetCustomAttributes(inherit); 377return UnderlyingType.GetCustomAttributes(attributeType, inherit); 417return UnderlyingType.IsDefined(attributeType, inherit);
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (4)
136_masterTypeTable.Add(bamlType.UnderlyingType, bamlType); 221if (xamlType != null && xamlType.UnderlyingType == type) 227if (xamlType != null && xamlType.UnderlyingType == type) 311return xamlType.UnderlyingType;
System\Windows\Markup\Baml2006\WpfSharedXamlSchemaContext.cs (1)
30if (xType == null || xType.UnderlyingType != type)
System\Windows\Markup\Baml2006\WpfXamlType.cs (12)
94if (UnderlyingType == typeof(ResourceDictionary)) 98else if (typeof(ResourceDictionary).IsAssignableFrom(UnderlyingType)) 100InterfaceMapping map = UnderlyingType.GetInterfaceMap(typeof(System.Windows.Markup.INameScope)); 225name, UnderlyingType); 296if ((property = DependencyProperty.FromName(name, this.UnderlyingType)) != null) 482if (UnderlyingType.IsArray) 486if (typeof(IDictionary).IsAssignableFrom(UnderlyingType)) 490if (typeof(IList).IsAssignableFrom(UnderlyingType)) 495if (typeof(System.Windows.Documents.DocumentReferenceCollection).IsAssignableFrom(UnderlyingType) || 496typeof(System.Windows.Documents.PageContentCollection).IsAssignableFrom(UnderlyingType)) 502if (typeof(ICollection<System.Windows.Data.XmlNamespaceMapping>).IsAssignableFrom(UnderlyingType) 521return typeof(System.Windows.Data.XmlNamespaceMappingCollection).IsAssignableFrom(UnderlyingType);
System\Windows\Markup\DependencyPropertyConverter.cs (2)
126type = schemaContext.GetXamlType(reader.ReadInt16()).UnderlyingType; 254return templateHolder.GetTypeForName(target).UnderlyingType;
System\Windows\Markup\RestrictiveXamlXmlReader.cs (1)
104if ((NodeType == System.Xaml.XamlNodeType.StartObject && !IsAllowedType(Type.UnderlyingType)) ||
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (3)
116if (xamlProperty.Type.UnderlyingType.IsEnum && schemaContext is Baml2006.Baml2006SchemaContext) 118typeConverter = XamlReader.BamlSharedSchemaContext.GetTypeConverter(xamlProperty.Type.UnderlyingType); 144if (xamlProperty != null && xamlProperty.Type.UnderlyingType == typeof(Boolean))
System\Windows\Markup\WpfXamlLoader.cs (3)
274FrameworkPropertyMetadata metadata = prop.GetMetadata(stack.CurrentFrame.Type.UnderlyingType) as FrameworkPropertyMetadata; 384if (typeof(DependencyObject).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 397typeof(Style).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType))
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
378return result == null || result.IsPublic ? result : GetInternalType(result.UnderlyingType, result);
System\Windows\TemplateContent.cs (32)
122(typeof(FrameworkTemplate).IsAssignableFrom(CurrentFrame.Type.UnderlyingType) || 123typeof(Style).IsAssignableFrom(CurrentFrame.Type.UnderlyingType))); 147(typeof(FrameworkTemplate).IsAssignableFrom(CurrentFrame.Type.UnderlyingType) || 148typeof(Style).IsAssignableFrom(CurrentFrame.Type.UnderlyingType))); 317OwnerTemplate.ChildTypeFromChildIndex.Add(childIndex, type.UnderlyingType); 411if (xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)) 431if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 432typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 459if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 460typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 484if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 485typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 501if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 522if (typeof(GridViewRowPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 551if (typeof(GridViewRowPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 558else if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 612IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 614IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 660if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 661typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 671if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) 726if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 727typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 749Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 817if (!typeof(FrameworkElement).IsAssignableFrom(parentType.UnderlyingType) && 818!typeof(FrameworkContentElement).IsAssignableFrom(parentType.UnderlyingType)) 891Type typeofValue = xamlReader.Type.UnderlyingType; 897if (!IsTypeShareable(xamlReader.Type.UnderlyingType)) 913if (typeof(FrameworkTemplate).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 918else if (typeof(Style).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 941if (typeof(StaticResourceExtension).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 1455return _schemaContext.GetXamlType(XamlTypeName.Parse(qualifiedTypeName, this)).UnderlyingType;
System.Xaml (102)
System\Xaml\Context\ObjectWriterContext.cs (3)
157if (xamlType is null || xamlType.UnderlyingType is null) 164return xamlType.UnderlyingType; 903if (xamlType.UnderlyingType is not null)
System\Xaml\Context\ServiceProviderContext.cs (1)
389return _xamlContext.GetDestinationType().UnderlyingType;
System\Xaml\Context\XamlParserContext.cs (2)
123allowProtectedForType = rootObjectType.UnderlyingType; 298allowProtectedForType = CurrentType.UnderlyingType;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (4)
1442typeof(IDictionary).IsAssignableFrom(dictionaryType.UnderlyingType) && 1443!IsBuiltInGenericDictionary(dictionaryType.UnderlyingType)) 1863if (itemType.UnderlyingType.IsAssignableFrom(type)) 2237Type rootInstanceType = (curInstance is not null) ? curInstance.GetType() : ctx.CurrentType.UnderlyingType;
System\Xaml\Parser\MeScanner.cs (2)
303(xamlType.UnderlyingType is not null && 304KS.Eq(xamlType.UnderlyingType.Name, typeName.Name + KnownStrings.Extension)))
System\Xaml\Runtime\ClrObjectRuntime.cs (5)
57throw CreateException(SR.Format(SR.NoConstructor, xamlType.UnderlyingType), ex); 66throw CreateException(SR.Format(SR.ConstructorInvocation, xamlType.UnderlyingType), UnwrapTargetInvocationException(ex)); 77Type type = xamlType.UnderlyingType; 391Type keyType = dictionaryType.KeyType.UnderlyingType; 392Type itemType = dictionaryType.ItemType.UnderlyingType;
System\Xaml\Runtime\DynamicMethodRuntime.cs (1)
196return CreateInstanceWithCtor(xamlType.UnderlyingType, args);
System\Xaml\Schema\TypeReflector.cs (2)
408if (xamlType.UnderlyingType is null) 415object obj = GetCustomAttribute(typeof(XAML3.NameScopePropertyAttribute), xamlType.UnderlyingType);
System\Xaml\Schema\XamlMemberInvoker.cs (1)
119args = new Type[] { _member.TargetType.UnderlyingType ?? typeof(object) };
System\Xaml\Schema\XamlNamespace.cs (3)
108Type openType = openXamlType?.UnderlyingType; 160Debug.Assert(typeArgs[n].UnderlyingType is not null); 162clrTypeArgs[n] = typeArgs[n].UnderlyingType;
System\Xaml\Schema\XamlTypeInvoker.cs (8)
128if (!_xamlType.UnderlyingType.IsValueType && (arguments is null || arguments.Length == 0)) 137return Activator.CreateInstance(_xamlType.UnderlyingType, arguments); 170_xamlType.UnderlyingType, type.UnderlyingType); 234Type type = _xamlType.UnderlyingType.UnderlyingSystemType; 244get { return _xamlType is null || _xamlType.UnderlyingType is null; } 274object inst = FormatterServices.GetUninitializedObject(type._xamlType.UnderlyingType); 308Type underlyingType = type._xamlType.UnderlyingType.UnderlyingSystemType;
System\Xaml\Schema\XamlValueConverter.cs (3)
73TargetType.UnderlyingType is not null && TargetType.UnderlyingType.IsEnum) 75return (TConverterBase)(object)new EnumConverter(TargetType.UnderlyingType);
System\Xaml\XamlObjectReader.cs (7)
1657if ((potentialProperty.Type.UnderlyingType == paraminfo.ParameterType) && 1697if (member is null && !valueXamlType.UnderlyingType.IsValueType) 1715if (((MemberMarkupInfo)property).IsFactoryMethod && !xamlType.UnderlyingType.IsNested) 1724if (xamlType.UnderlyingType.IsNested) 2117property.Type.UnderlyingType == parameter.ParameterType) 3246if (member.DeclaringType.UnderlyingType == baseDeclaringType) 3269if (baseType.UnderlyingType == baseDeclaringType)
System\Xaml\XamlSchemaContext.cs (3)
322if (typeArg.UnderlyingType is null) 339result = GetXamlType(result.UnderlyingType); 923Type clrType = type.UnderlyingType;
System\Xaml\XamlType.cs (54)
438Type baseUnderlyingType = xamlType.UnderlyingType; 442Type curUnderlyingType = curType.UnderlyingType; 518if (ItemType is null || UnderlyingType is null) 526if (UnderlyingType is not null && ItemType.UnderlyingType is not null) 529GetIsReadOnlyMethod(UnderlyingType, ItemType.UnderlyingType); 572if (UnderlyingType is null) 581_reflector.AddMethod = CollectionReflector.LookupAddMethod(UnderlyingType, collectionKind); 592if (GetCollectionKind() == XamlCollectionKind.None || UnderlyingType is null) 600_reflector.GetEnumeratorMethod = CollectionReflector.GetEnumeratorMethod(UnderlyingType); 627Type underlyingType = UnderlyingType; 647if (UnderlyingType is null) 654return UnderlyingType.GetConstructors(); 663if (UnderlyingType is null) 749Type underlyingType = UnderlyingType; 765if (UnderlyingType is null) 771XamlCollectionKind result = CollectionReflector.LookupCollectionKind(UnderlyingType, out addMethod); 782Type underlyingType = UnderlyingType; 879Type underlyingType = UnderlyingType; 918return (UnderlyingType is not null) ? new XamlTypeInvoker(this) : null; 933if (UnderlyingType is not null) 935return !UnderlyingType.IsValueType || IsNullableGeneric(); 948return UnderlyingType is null; 987else if (UnderlyingType is null && BaseType is not null) 1011else if (UnderlyingType is not null) 1013if (UnderlyingType.IsArray) 1015result = UnderlyingType.GetElementType(); 1049if (UnderlyingType is null) 1060if (UnderlyingType is null) 1097if (UnderlyingType is null) 1134if (UnderlyingType is null) 1163if (UnderlyingType is null) 1190Type underlyingType = UnderlyingType; 1250Type underlyingType = UnderlyingType; 1297Type underlyingType = UnderlyingType; 1361if (UnderlyingType is not null) 1372typeof(EventHandler<XamlSetMarkupExtensionEventArgs>), UnderlyingType, methodName); 1386if (UnderlyingType is not null) 1397typeof(EventHandler<XamlSetTypeConverterEventArgs>), UnderlyingType, methodName); 1495reflector = new TypeReflector(UnderlyingType); 1552foreach (ConstructorInfo ctor in UnderlyingType.GetConstructors(ConstructorBindingFlags)) 1640return UnderlyingType is not null 1641&& (KS.Eq(UnderlyingType.Name, KnownStrings.NullableOfT) 1642&& UnderlyingType.Assembly == typeof(Nullable<>).Assembly 1643&& UnderlyingType.Namespace == typeof(Nullable<>).Namespace); 1648if (UnderlyingType is null) 1685if (UnderlyingType == XamlLanguage.Type.UnderlyingType) 1711throw new XamlSchemaException(SR.Format(SR.MarkupExtensionWithDuplicateArity, UnderlyingType, typeVector.Length)); 1860else if (UnderlyingType is not null) 1863return UnderlyingType.GetHashCode() ^ 8; 1920return xamlType1.UnderlyingType == xamlType2.UnderlyingType;
System\Xaml\XamlXmlWriter.cs (3)
1908Type objectClrType = objectXamlType.UnderlyingType; 1933if ((potentialProperty.Type.UnderlyingType == paraminfo.ParameterType) && 1973Type underlyingType = xamlType.UnderlyingType;
System.Xaml.Tests (54)
System\Xaml\XamlLanguageTests.cs (50)
34Assert.Equal(typeof(ArrayExtension), type.UnderlyingType); 45Assert.Equal(typeof(MemberDefinition), type.UnderlyingType); 56Assert.Equal(typeof(NullExtension), type.UnderlyingType); 67Assert.Equal(typeof(PropertyDefinition), type.UnderlyingType); 78Assert.Equal(typeof(Reference), type.UnderlyingType); 89Assert.Equal(typeof(StaticExtension), type.UnderlyingType); 100Assert.Equal(typeof(TypeExtension), type.UnderlyingType); 111Assert.Equal(typeof(string), type.UnderlyingType); 122Assert.Equal(typeof(double), type.UnderlyingType); 133Assert.Equal(typeof(int), type.UnderlyingType); 144Assert.Equal(typeof(bool), type.UnderlyingType); 155Assert.Equal(typeof(XData), type.UnderlyingType); 166Assert.Equal(typeof(object), type.UnderlyingType); 177Assert.Equal(typeof(char), type.UnderlyingType); 188Assert.Equal(typeof(float), type.UnderlyingType); 199Assert.Equal(typeof(byte), type.UnderlyingType); 210Assert.Equal(typeof(short), type.UnderlyingType); 221Assert.Equal(typeof(long), type.UnderlyingType); 232Assert.Equal(typeof(decimal), type.UnderlyingType); 243Assert.Equal(typeof(Uri), type.UnderlyingType); 254Assert.Equal(typeof(TimeSpan), type.UnderlyingType); 274Assert.Equal(typeof(List<object>), directive.Type.UnderlyingType); 275Assert.Equal(new Type[] { typeof(object) }, directive.Type.TypeArguments.Select(t => t.UnderlyingType)); 287Assert.Equal(typeof(string), directive.Type.UnderlyingType); 300Assert.Equal(typeof(string), directive.Type.UnderlyingType); 313Assert.Equal(typeof(string), directive.Type.UnderlyingType); 326Assert.Equal(typeof(string), directive.Type.UnderlyingType); 339Assert.Equal(typeof(string), directive.Type.UnderlyingType); 352Assert.Equal(typeof(string), directive.Type.UnderlyingType); 365Assert.Equal(typeof(string), directive.Type.UnderlyingType); 378Assert.Equal(typeof(List<object>), directive.Type.UnderlyingType); 379Assert.Equal(new Type[] { typeof(object) }, directive.Type.TypeArguments.Select(t => t.UnderlyingType)); 391Assert.Equal(typeof(object), directive.Type.UnderlyingType); 404Assert.Equal(typeof(object), directive.Type.UnderlyingType); 417Assert.Equal(typeof(List<MemberDefinition>), directive.Type.UnderlyingType); 418Assert.Equal(new Type[] { typeof(MemberDefinition) }, directive.Type.TypeArguments.Select(t => t.UnderlyingType)); 430Assert.Equal(typeof(List<Attribute>), directive.Type.UnderlyingType); 431Assert.Equal(new Type[] { typeof(Attribute) }, directive.Type.TypeArguments.Select(t => t.UnderlyingType)); 443Assert.Equal(typeof(string), directive.Type.UnderlyingType); 456Assert.Equal(typeof(List<object>), directive.Type.UnderlyingType); 457Assert.Equal(new Type[] { typeof(object) }, directive.Type.TypeArguments.Select(t => t.UnderlyingType)); 469Assert.Equal(typeof(string), directive.Type.UnderlyingType); 482Assert.Equal(typeof(string), directive.Type.UnderlyingType); 495Assert.Equal(typeof(string), directive.Type.UnderlyingType); 508Assert.Equal(typeof(string), directive.Type.UnderlyingType); 521Assert.Equal(typeof(string), directive.Type.UnderlyingType); 534Assert.Equal(typeof(object), directive.Type.UnderlyingType); 547Assert.Equal(typeof(string), directive.Type.UnderlyingType); 560Assert.Equal(typeof(string), directive.Type.UnderlyingType); 573Assert.Equal(typeof(string), directive.Type.UnderlyingType);
System\Xaml\XamlSchemaContextTests.cs (1)
1001Assert.Equal(underlyingType, type.UnderlyingType);
System\Xaml\XamlTypeTests.cs (3)
4431Assert.Null(type.UnderlyingType); 4439Assert.Equal(typeof(int), type.UnderlyingType); 4450Assert.Equal(typeof(int), type.UnderlyingType);