Exemplo n.º 1
0
 public ResourceType(Type instanceType, System.Data.Services.Providers.ResourceTypeKind resourceTypeKind, ResourceType baseType, string namespaceName, string name, bool isAbstract) : this(instanceType, baseType, namespaceName, name, isAbstract)
 {
     WebUtil.CheckArgumentNull <Type>(instanceType, "instanceType");
     WebUtil.CheckStringArgumentNullOrEmpty(name, "name");
     WebUtil.CheckResourceTypeKind(resourceTypeKind, "resourceTypeKind");
     if (((resourceTypeKind == System.Data.Services.Providers.ResourceTypeKind.Primitive) || (resourceTypeKind == System.Data.Services.Providers.ResourceTypeKind.Collection)) || (resourceTypeKind == System.Data.Services.Providers.ResourceTypeKind.EntityCollection))
     {
         throw new ArgumentException(System.Data.Services.Strings.ResourceType_InvalidValueForResourceTypeKind("resourceTypeKind"), "resourceTypeKind");
     }
     if ((baseType != null) && (baseType.ResourceTypeKind != resourceTypeKind))
     {
         throw new ArgumentException(System.Data.Services.Strings.ResourceType_InvalidResourceTypeKindInheritance(resourceTypeKind.ToString(), baseType.ResourceTypeKind.ToString()), "resourceTypeKind");
     }
     if (instanceType.IsValueType)
     {
         throw new ArgumentException(System.Data.Services.Strings.ResourceType_TypeCannotBeValueType, "instanceType");
     }
     this.resourceTypeKind = resourceTypeKind;
 }