本文整理汇总了C#中Type.NestingNamespace方法的典型用法代码示例。如果您正苦于以下问题:C# Type.NestingNamespace方法的具体用法?C# Type.NestingNamespace怎么用?C# Type.NestingNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type.NestingNamespace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrimitiveType
// <summary>
// The constructor for PrimitiveType, it takes in a CLR type containing the identity information
// </summary>
// <param name="clrType"> The CLR type object for this primitive type </param>
// <param name="baseType"> The base type for this primitive type </param>
// <param name="providerManifest"> The ProviderManifest of the provider of this type </param>
internal PrimitiveType(
Type clrType,
PrimitiveType baseType,
DbProviderManifest providerManifest)
: this(Check.NotNull(clrType, "clrType").Name, clrType.NestingNamespace(),
DataSpace.OSpace, baseType, providerManifest)
{
Debug.Assert(clrType == ClrEquivalentType, "not equivalent to ClrEquivalentType");
}
示例2: ClrEntityType
/// <summary>
/// Initializes a new instance of Complex Type with properties from the type.
/// </summary>
/// <param name="type"> The CLR type to construct from </param>
internal ClrEntityType(Type type, string cspaceNamespaceName, string cspaceTypeName)
: base(Check.NotNull(type, "type").Name, type.NestingNamespace() ?? string.Empty,
DataSpace.OSpace)
{
DebugCheck.NotEmpty(cspaceNamespaceName);
DebugCheck.NotEmpty(cspaceTypeName);
_type = type;
_cspaceNamespaceName = cspaceNamespaceName;
_cspaceTypeName = cspaceNamespaceName + "." + cspaceTypeName;
Abstract = type.IsAbstract;
}
示例3: EnumType
// <summary>
// Initializes a new instance of the EnumType class from CLR enumeration type.
// </summary>
// <param name="clrType"> CLR enumeration type to create EnumType from. </param>
// <remarks>
// Note that this method expects that the <paramref name="clrType" /> is a valid CLR enum type
// whose underlying type is a valid EDM primitive type.
// Ideally this constructor should be protected and internal (Family and Assembly modifier) but
// C# does not support this. In order to not expose this constructor to everyone internal is the
// only option.
// </remarks>
internal EnumType(Type clrType)
:
base(clrType.Name, clrType.NestingNamespace() ?? string.Empty, DataSpace.OSpace)
{
DebugCheck.NotNull(clrType);
Debug.Assert(clrType.IsEnum(), "enum type expected");
ClrProviderManifest.Instance.TryGetPrimitiveType(clrType.GetEnumUnderlyingType(), out _underlyingType);
Debug.Assert(_underlyingType != null, "only primitive types expected here.");
Debug.Assert(
Helper.IsSupportedEnumUnderlyingType(_underlyingType.PrimitiveTypeKind),
"unsupported CLR types should have been filtered out by .TryGetPrimitiveType() method.");
_isFlags = clrType.GetCustomAttributes<FlagsAttribute>(inherit: false).Any();
foreach (var name in Enum.GetNames(clrType))
{
AddMember(
new EnumMember(
name,
Convert.ChangeType(Enum.Parse(clrType, name), clrType.GetEnumUnderlyingType(), CultureInfo.InvariantCulture)));
}
}
示例4: ClrComplexType
/// <summary>
/// Initializes a new instance of Complex Type with properties from the type.
/// </summary>
/// <param name="clrType"> The CLR type to construct from </param>
internal ClrComplexType(Type clrType, string cspaceNamespaceName, string cspaceTypeName)
: base(Check.NotNull(clrType, "clrType").Name, clrType.NestingNamespace() ?? string.Empty,
DataSpace.OSpace)
{
DebugCheck.NotEmpty(cspaceNamespaceName);
DebugCheck.NotEmpty(cspaceTypeName);
_type = clrType;
_cspaceTypeName = cspaceNamespaceName + "." + cspaceTypeName;
Abstract = clrType.IsAbstract;
}
示例5: MetadataPropertyAttribute
/// <summary>
/// Initialize a new attribute with complex type kind (corresponding the the CLR type)
/// </summary>
/// <param name="type"> CLR type setting Type property </param>
/// <param name="isCollection"> Sets IsCollectionType property </param>
internal MetadataPropertyAttribute(Type type, bool isCollection)
: this(ClrComplexType.CreateReadonlyClrComplexType(type, type.NestingNamespace() ?? string.Empty, type.Name), isCollection)
{
}