240 references to UnderlyingType
PresentationFramework (84)
System\Windows\Controls\ItemsPresenter.cs (1)
318type = xType.UnderlyingType;
System\Windows\FrameworkTemplate.cs (1)
576if (typeof(ResourceDictionary).IsAssignableFrom(type.UnderlyingType))
System\Windows\Markup\Baml2006\Baml2006Reader.cs (18)
882optimizedStaticResource.KeyValue = xamlType.UnderlyingType; 1063!_context.CurrentFrame.Member.Type.UnderlyingType.IsAssignableFrom(typeof(String))) 1091_xamlNodesWriter.WriteValue(BamlSchemaContext.GetXamlType(typeId).UnderlyingType); 1373if (_context.CurrentFrame.XamlType.UnderlyingType == typeof(EventSetter)) 1378Type currentType = eventProperty.DeclaringType.UnderlyingType; 1388eventProperty.DeclaringType.UnderlyingType); 1532converter = new EnumConverter(_context.CurrentFrame.XamlType.UnderlyingType); 1550Type type = BamlSchemaContext.GetXamlType(_binaryReader.ReadInt16()).UnderlyingType; 1590Type propertyType = property.Type.UnderlyingType; 1683param = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1699param = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1794typeExtensionType = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1830value = BamlSchemaContext.GetXamlType(valueId).UnderlyingType; 1865_xamlNodesWriter.WriteValue(type.UnderlyingType); 1944_xamlNodesWriter.WriteValue(xamlType.UnderlyingType); 2514return Enum.ToObject(type.UnderlyingType, bytes).ToString(); 2588Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty)); 2667memberType = BamlSchemaContext.GetPropertyDeclaringType(valueId).UnderlyingType;
System\Windows\Markup\Baml2006\Baml2006ReaderInternal.cs (1)
49property.DeclaringType.UnderlyingType == typeof(System.Windows.ResourceDictionary) &&
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
152return xamlType.UnderlyingType;
System\Windows\Markup\Baml2006\WpfKnownType.cs (3)
360return UnderlyingType.GetCustomAttributes(inherit); 378return UnderlyingType.GetCustomAttributes(attributeType, inherit); 418return UnderlyingType.IsDefined(attributeType, inherit);
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (4)
137_masterTypeTable.Add(bamlType.UnderlyingType, bamlType); 222if (xamlType != null && xamlType.UnderlyingType == type) 228if (xamlType != null && xamlType.UnderlyingType == type) 312return xamlType.UnderlyingType;
System\Windows\Markup\Baml2006\WpfSharedXamlSchemaContext.cs (1)
31if (xType == null || xType.UnderlyingType != type)
System\Windows\Markup\Baml2006\WpfXamlType.cs (12)
95if (UnderlyingType == typeof(ResourceDictionary)) 99else if (typeof(ResourceDictionary).IsAssignableFrom(UnderlyingType)) 101InterfaceMapping map = UnderlyingType.GetInterfaceMap(typeof(System.Windows.Markup.INameScope)); 226name, UnderlyingType); 297if ((property = DependencyProperty.FromName(name, this.UnderlyingType)) != null) 483if (UnderlyingType.IsArray) 487if (typeof(IDictionary).IsAssignableFrom(UnderlyingType)) 491if (typeof(IList).IsAssignableFrom(UnderlyingType)) 496if (typeof(System.Windows.Documents.DocumentReferenceCollection).IsAssignableFrom(UnderlyingType) || 497typeof(System.Windows.Documents.PageContentCollection).IsAssignableFrom(UnderlyingType)) 503if (typeof(ICollection<System.Windows.Data.XmlNamespaceMapping>).IsAssignableFrom(UnderlyingType) 522return typeof(System.Windows.Data.XmlNamespaceMappingCollection).IsAssignableFrom(UnderlyingType);
System\Windows\Markup\DependencyPropertyConverter.cs (2)
127type = schemaContext.GetXamlType(reader.ReadInt16()).UnderlyingType; 255return templateHolder.GetTypeForName(target).UnderlyingType;
System\Windows\Markup\RestrictiveXamlXmlReader.cs (1)
105if ((NodeType == System.Xaml.XamlNodeType.StartObject && !IsAllowedType(Type.UnderlyingType)) ||
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (3)
117if (xamlProperty.Type.UnderlyingType.IsEnum && schemaContext is Baml2006.Baml2006SchemaContext) 119typeConverter = XamlReader.BamlSharedSchemaContext.GetTypeConverter(xamlProperty.Type.UnderlyingType); 145if (xamlProperty != null && xamlProperty.Type.UnderlyingType == typeof(Boolean))
System\Windows\Markup\WpfXamlLoader.cs (3)
275FrameworkPropertyMetadata metadata = prop.GetMetadata(stack.CurrentFrame.Type.UnderlyingType) as FrameworkPropertyMetadata; 385if (typeof(DependencyObject).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 398typeof(Style).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType))
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
379return result == null || result.IsPublic ? result : GetInternalType(result.UnderlyingType, result);
System\Windows\TemplateContent.cs (32)
123(typeof(FrameworkTemplate).IsAssignableFrom(CurrentFrame.Type.UnderlyingType) || 124typeof(Style).IsAssignableFrom(CurrentFrame.Type.UnderlyingType))); 148(typeof(FrameworkTemplate).IsAssignableFrom(CurrentFrame.Type.UnderlyingType) || 149typeof(Style).IsAssignableFrom(CurrentFrame.Type.UnderlyingType))); 318OwnerTemplate.ChildTypeFromChildIndex.Add(childIndex, type.UnderlyingType); 412if (xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)) 432if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 433typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 460if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 461typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 485if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 486typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 502if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 523if (typeof(GridViewRowPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 552if (typeof(GridViewRowPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 559else if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 615IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 617IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 663if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 664typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 674if (typeof(ContentPresenter).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) 729if (typeof(FrameworkElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType) || 730typeof(FrameworkContentElement).IsAssignableFrom(stack.CurrentFrame.Type.UnderlyingType)) 752Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 820if (!typeof(FrameworkElement).IsAssignableFrom(parentType.UnderlyingType) && 821!typeof(FrameworkContentElement).IsAssignableFrom(parentType.UnderlyingType)) 894Type typeofValue = xamlReader.Type.UnderlyingType; 900if (!IsTypeShareable(xamlReader.Type.UnderlyingType)) 916if (typeof(FrameworkTemplate).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 921else if (typeof(Style).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 944if (typeof(StaticResourceExtension).IsAssignableFrom(xamlReader.Type.UnderlyingType)) 1458return _schemaContext.GetXamlType(XamlTypeName.Parse(qualifiedTypeName, this)).UnderlyingType;
System.Xaml (102)
System\Xaml\Context\ObjectWriterContext.cs (3)
159if (xamlType is null || xamlType.UnderlyingType is null) 166return xamlType.UnderlyingType; 905if (xamlType.UnderlyingType is not null)
System\Xaml\Context\ServiceProviderContext.cs (1)
390return _xamlContext.GetDestinationType().UnderlyingType;
System\Xaml\Context\XamlParserContext.cs (2)
124allowProtectedForType = rootObjectType.UnderlyingType; 299allowProtectedForType = CurrentType.UnderlyingType;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (4)
1443typeof(IDictionary).IsAssignableFrom(dictionaryType.UnderlyingType) && 1444!IsBuiltInGenericDictionary(dictionaryType.UnderlyingType)) 1864if (itemType.UnderlyingType.IsAssignableFrom(type)) 2238Type rootInstanceType = (curInstance is not null) ? curInstance.GetType() : ctx.CurrentType.UnderlyingType;
System\Xaml\Parser\MeScanner.cs (2)
304(xamlType.UnderlyingType is not null && 305KS.Eq(xamlType.UnderlyingType.Name, typeName.Name + KnownStrings.Extension)))
System\Xaml\Runtime\ClrObjectRuntime.cs (5)
58throw CreateException(SR.Format(SR.NoConstructor, xamlType.UnderlyingType), ex); 67throw CreateException(SR.Format(SR.ConstructorInvocation, xamlType.UnderlyingType), UnwrapTargetInvocationException(ex)); 78Type type = xamlType.UnderlyingType; 392Type keyType = dictionaryType.KeyType.UnderlyingType; 393Type itemType = dictionaryType.ItemType.UnderlyingType;
System\Xaml\Runtime\DynamicMethodRuntime.cs (1)
195return CreateInstanceWithCtor(xamlType.UnderlyingType, args);
System\Xaml\Schema\TypeReflector.cs (2)
409if (xamlType.UnderlyingType is null) 416object obj = GetCustomAttribute(typeof(XAML3.NameScopePropertyAttribute), xamlType.UnderlyingType);
System\Xaml\Schema\XamlMemberInvoker.cs (1)
121args = 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)
129if (!_xamlType.UnderlyingType.IsValueType && (arguments is null || arguments.Length == 0)) 138return Activator.CreateInstance(_xamlType.UnderlyingType, arguments); 171_xamlType.UnderlyingType, type.UnderlyingType); 235Type type = _xamlType.UnderlyingType.UnderlyingSystemType; 245get { return _xamlType is null || _xamlType.UnderlyingType is null; } 275object inst = FormatterServices.GetUninitializedObject(type._xamlType.UnderlyingType); 309Type underlyingType = type._xamlType.UnderlyingType.UnderlyingSystemType;
System\Xaml\Schema\XamlValueConverter.cs (3)
74TargetType.UnderlyingType is not null && TargetType.UnderlyingType.IsEnum) 76return (TConverterBase)(object)new EnumConverter(TargetType.UnderlyingType);
System\Xaml\XamlObjectReader.cs (7)
1658if ((potentialProperty.Type.UnderlyingType == paraminfo.ParameterType) && 1698if (member is null && !valueXamlType.UnderlyingType.IsValueType) 1716if (((MemberMarkupInfo)property).IsFactoryMethod && !xamlType.UnderlyingType.IsNested) 1725if (xamlType.UnderlyingType.IsNested) 2118property.Type.UnderlyingType == parameter.ParameterType) 3247if (member.DeclaringType.UnderlyingType == baseDeclaringType) 3270if (baseType.UnderlyingType == baseDeclaringType)
System\Xaml\XamlSchemaContext.cs (3)
323if (typeArg.UnderlyingType is null) 340result = GetXamlType(result.UnderlyingType); 924Type clrType = type.UnderlyingType;
System\Xaml\XamlType.cs (54)
439Type baseUnderlyingType = xamlType.UnderlyingType; 443Type curUnderlyingType = curType.UnderlyingType; 519if (ItemType is null || UnderlyingType is null) 527if (UnderlyingType is not null && ItemType.UnderlyingType is not null) 530GetIsReadOnlyMethod(UnderlyingType, ItemType.UnderlyingType); 573if (UnderlyingType is null) 582_reflector.AddMethod = CollectionReflector.LookupAddMethod(UnderlyingType, collectionKind); 593if (GetCollectionKind() == XamlCollectionKind.None || UnderlyingType is null) 601_reflector.GetEnumeratorMethod = CollectionReflector.GetEnumeratorMethod(UnderlyingType); 628Type underlyingType = UnderlyingType; 648if (UnderlyingType is null) 655return UnderlyingType.GetConstructors(); 664if (UnderlyingType is null) 750Type underlyingType = UnderlyingType; 766if (UnderlyingType is null) 772XamlCollectionKind result = CollectionReflector.LookupCollectionKind(UnderlyingType, out addMethod); 783Type underlyingType = UnderlyingType; 880Type underlyingType = UnderlyingType; 919return (UnderlyingType is not null) ? new XamlTypeInvoker(this) : null; 934if (UnderlyingType is not null) 936return !UnderlyingType.IsValueType || IsNullableGeneric(); 949return UnderlyingType is null; 988else if (UnderlyingType is null && BaseType is not null) 1012else if (UnderlyingType is not null) 1014if (UnderlyingType.IsArray) 1016result = UnderlyingType.GetElementType(); 1050if (UnderlyingType is null) 1061if (UnderlyingType is null) 1098if (UnderlyingType is null) 1135if (UnderlyingType is null) 1164if (UnderlyingType is null) 1191Type underlyingType = UnderlyingType; 1251Type underlyingType = UnderlyingType; 1298Type underlyingType = UnderlyingType; 1362if (UnderlyingType is not null) 1373typeof(EventHandler<XamlSetMarkupExtensionEventArgs>), UnderlyingType, methodName); 1387if (UnderlyingType is not null) 1398typeof(EventHandler<XamlSetTypeConverterEventArgs>), UnderlyingType, methodName); 1496reflector = new TypeReflector(UnderlyingType); 1553foreach (ConstructorInfo ctor in UnderlyingType.GetConstructors(ConstructorBindingFlags)) 1642return UnderlyingType is not null 1643&& (KS.Eq(UnderlyingType.Name, KnownStrings.NullableOfT) 1644&& UnderlyingType.Assembly == typeof(Nullable<>).Assembly 1645&& UnderlyingType.Namespace == typeof(Nullable<>).Namespace); 1650if (UnderlyingType is null) 1687if (UnderlyingType == XamlLanguage.Type.UnderlyingType) 1713throw new XamlSchemaException(SR.Format(SR.MarkupExtensionWithDuplicateArity, UnderlyingType, typeVector.Length)); 1862else if (UnderlyingType is not null) 1865return UnderlyingType.GetHashCode() ^ 8; 1922return xamlType1.UnderlyingType == xamlType2.UnderlyingType;
System\Xaml\XamlXmlWriter.cs (3)
1927Type objectClrType = objectXamlType.UnderlyingType; 1952if ((potentialProperty.Type.UnderlyingType == paraminfo.ParameterType) && 1992Type 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);