示例#1
0
文件: Type.cs 项目: wenchaoli/corefx
 public bool IsCollectionType()
 {
     if ((AssociatedSystemType.IsGenericType &&
          (AssociatedSystemType.GetGenericTypeDefinition() == typeof(IList <>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(ICollection <>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(IEnumerable <>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(IReadOnlyList <>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(IReadOnlyCollection <>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(IDictionary <,>) ||
           AssociatedSystemType.GetGenericTypeDefinition() == typeof(IReadOnlyDictionary <,>))) ||
         AssociatedSystemType == typeof(System.Collections.IList) ||
         AssociatedSystemType == typeof(System.Collections.ICollection) ||
         AssociatedSystemType == typeof(System.Collections.IEnumerable) ||
         AssociatedSystemType == typeof(System.Collections.Specialized.INotifyCollectionChanged) ||
         AssociatedSystemType == typeof(System.ComponentModel.INotifyPropertyChanged))
     {
         return(true);
     }
     return(false);
 }
示例#2
0
文件: Type.cs 项目: sgwzxg/corefx
 public bool IsWindowsRuntimeType()
 {
     return((AssociatedSystemType.GetTypeInfo().Attributes & TypeAttributes.WindowsRuntime) == TypeAttributes.WindowsRuntime);
 }