本文整理汇总了C#中TypeKind类的典型用法代码示例。如果您正苦于以下问题:C# TypeKind类的具体用法?C# TypeKind怎么用?C# TypeKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeKind类属于命名空间,在下文中一共展示了TypeKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CodeGenerationNamedTypeSymbol
public CodeGenerationNamedTypeSymbol(
INamedTypeSymbol containingType,
IList<AttributeData> attributes,
Accessibility declaredAccessibility,
DeclarationModifiers modifiers,
TypeKind typeKind,
string name,
IList<ITypeParameterSymbol> typeParameters,
INamedTypeSymbol baseType,
IList<INamedTypeSymbol> interfaces,
SpecialType specialType,
IList<ISymbol> members,
IList<CodeGenerationAbstractNamedTypeSymbol> typeMembers,
INamedTypeSymbol enumUnderlyingType)
: base(containingType, attributes, declaredAccessibility, modifiers, name, specialType, typeMembers)
{
_typeKind = typeKind;
_typeParameters = typeParameters ?? SpecializedCollections.EmptyList<ITypeParameterSymbol>();
_baseType = baseType;
_interfaces = interfaces ?? SpecializedCollections.EmptyList<INamedTypeSymbol>();
_members = members ?? SpecializedCollections.EmptyList<ISymbol>();
_enumUnderlyingType = enumUnderlyingType;
this.OriginalDefinition = this;
}
开发者ID:RoryVL,项目名称:roslyn,代码行数:25,代码来源:CodeGenerationNamedTypeSymbol.cs
示例2: KindsRestriction
public KindsRestriction(TypeKind[] kinds)
{
if (kinds == null)
throw Error.ArgumentNull("kinds");
this.kinds = kinds;
}
开发者ID:sharpjs,项目名称:Projector,代码行数:7,代码来源:KindsRestriction.cs
示例3: GenerateTypeOptionsResult
public GenerateTypeOptionsResult(
Accessibility accessibility,
TypeKind typeKind,
string typeName,
Project project,
bool isNewFile,
string newFileName,
IList<string> folders,
string fullFilePath,
Document existingDocument,
bool areFoldersValidIdentifiers,
bool isCancelled = false)
{
this.Accessibility = accessibility;
this.TypeKind = typeKind;
this.TypeName = typeName;
this.Project = project;
this.IsNewFile = isNewFile;
this.NewFileName = newFileName;
this.Folders = folders;
this.FullFilePath = fullFilePath;
this.ExistingDocument = existingDocument;
this.AreFoldersValidIdentifiers = areFoldersValidIdentifiers;
this.IsCancelled = isCancelled;
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:25,代码来源:GenerateTypeOptionsResult.cs
示例4: SynthesizedContainer
internal SynthesizedContainer(MethodSymbol topLevelMethod, string name, TypeKind typeKind)
{
this.typeKind = typeKind;
this.containingSymbol = topLevelMethod.ContainingType;
this.name = name;
this.TypeMap = TypeMap.Empty.WithAlphaRename(topLevelMethod, this, out this.typeParameters);
}
开发者ID:riversky,项目名称:roslyn,代码行数:7,代码来源:SynthesizedContainer.cs
示例5: MockType
public MockType(string name = "", bool? isReferenceType = false, TypeKind kind = TypeKind.Class)
{
this.name = name;
this.isReferenceType = isReferenceType;
this.kind = kind;
BaseTypes = new List<IType>();
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:7,代码来源:IsTypeCriterionTests.cs
示例6: SetGenerateTypeOptions
public void SetGenerateTypeOptions(
Accessibility accessibility = Accessibility.NotApplicable,
TypeKind typeKind = TypeKind.Class,
string typeName = null,
Project project = null,
bool isNewFile = false,
string newFileName = null,
IList<string> folders = null,
string fullFilePath = null,
Document existingDocument = null,
bool areFoldersValidIdentifiers = true,
string defaultNamespace = null,
bool isCancelled = false)
{
Accessibility = accessibility;
TypeKind = typeKind;
TypeName = typeName;
Project = project;
IsNewFile = isNewFile;
NewFileName = newFileName;
Folders = folders;
FullFilePath = fullFilePath;
ExistingDocument = existingDocument;
AreFoldersValidIdentifiers = areFoldersValidIdentifiers;
DefaultNamespace = defaultNamespace;
IsCancelled = isCancelled;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:27,代码来源:TestGenerateTypeOptionsService.cs
示例7: TypeDesc
internal TypeDesc(string name, string fullName, XmlSchemaType dataType, TypeKind kind, TypeDesc baseTypeDesc, TypeFlags flags, string formatterName)
{
this.name = name.Replace('+', '.');
this.fullName = fullName.Replace('+', '.');
this.kind = kind;
this.baseTypeDesc = baseTypeDesc;
this.flags = flags;
this.isXsdType = kind == TypeKind.Primitive;
if (this.isXsdType)
{
this.weight = 1;
}
else if (kind == TypeKind.Enum)
{
this.weight = 2;
}
else if (this.kind == TypeKind.Root)
{
this.weight = -1;
}
else
{
this.weight = (baseTypeDesc == null) ? 0 : (baseTypeDesc.Weight + 1);
}
this.dataType = dataType;
this.formatterName = formatterName;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:TypeDesc.cs
示例8: HasKind
private bool HasKind(TypeKind candidate)
{
foreach (var kind in kinds)
if (kind == candidate)
return true;
return false;
}
开发者ID:sharpjs,项目名称:Projector,代码行数:8,代码来源:KindsRestriction.cs
示例9: AsyncStateMachine
public AsyncStateMachine(VariableSlotAllocator variableAllocatorOpt, TypeCompilationState compilationState, MethodSymbol asyncMethod, int asyncMethodOrdinal, TypeKind typeKind)
: base(variableAllocatorOpt, compilationState, asyncMethod, asyncMethodOrdinal)
{
// TODO: report use-site errors on these types
_typeKind = typeKind;
_interfaces = ImmutableArray.Create(asyncMethod.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IAsyncStateMachine));
_constructor = new AsyncConstructor(this);
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:8,代码来源:AsyncStateMachine.cs
示例10: TypeSpecifier
public TypeSpecifier(string name, TypeKind kind,
TypedNodeList typeParameters, Location location)
: base(location)
{
this.name = name;
this.kind = kind;
this.typeParameters = typeParameters;
}
开发者ID:shugo,项目名称:babel,代码行数:8,代码来源:typespec.cs
示例11: AsyncStateMachine
public AsyncStateMachine(MethodSymbol asyncMethod, TypeKind typeKind)
: base(GeneratedNames.MakeStateMachineTypeName(asyncMethod.Name, SequenceNumber(asyncMethod)), asyncMethod)
{
// TODO: report use-site errors on these types
this.typeKind = typeKind;
this.asyncMethod = asyncMethod;
this.interfaces = ImmutableArray.Create(asyncMethod.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IAsyncStateMachine));
this.constructor = new AsyncConstructor(this);
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:AsyncStateMachine.cs
示例12: TypeDesc
public TypeDesc(string name, string fullName, TypeKind kind, TypeDesc baseTypeDesc, TypeFlags flags) {
this.name = name.Replace('+', '.');
this.fullName = fullName.Replace('+', '.');
this.kind = kind;
if (baseTypeDesc != null) {
this.baseTypeDesc = baseTypeDesc;
}
this.flags = flags;
this.isXsdType = kind == TypeKind.Primitive;
}
开发者ID:ArildF,项目名称:masters,代码行数:10,代码来源:types.cs
示例13: ToString
public static string ToString(TypeKind typeKind, object value)
{
switch (typeKind)
{
case TypeKind.String:
return (string)value;
case TypeKind.IgnoreCaseString:
return ((IgnoreCaseString)value).Value;
case TypeKind.Char:
return ((char)value).ToString();
case TypeKind.Decimal:
return ((decimal)value).ToInvString();
case TypeKind.Int64:
return ((long)value).ToInvString();
case TypeKind.Int32:
return ((int)value).ToInvString();
case TypeKind.Int16:
return ((short)value).ToInvString();
case TypeKind.SByte:
return ((sbyte)value).ToInvString();
case TypeKind.UInt64:
return ((ulong)value).ToInvString();
case TypeKind.UInt32:
return ((uint)value).ToInvString();
case TypeKind.UInt16:
return ((ushort)value).ToInvString();
case TypeKind.Byte:
return ((byte)value).ToInvString();
case TypeKind.Double:
{
bool isLiteral;
return ((double)value).ToInvString(out isLiteral);
}
case TypeKind.Single:
{
bool isLiteral;
return ((float)value).ToInvString(out isLiteral);
}
case TypeKind.Boolean:
return ((bool)value).ToInvString();
case TypeKind.Binary:
return ((Binary)value).ToBase64String();
case TypeKind.Guid:
return ((Guid)value).ToInvString();
case TypeKind.TimeSpan:
return ((TimeSpan)value).ToInvString();
case TypeKind.DateTimeOffset:
return ((DateTimeOffset)value).ToInvString();
default:
throw new ArgumentException("Invalid type kind: " + typeKind.ToString());
}
}
开发者ID:knat,项目名称:SData,代码行数:53,代码来源:AtomExtensions.cs
示例14: ModifiedType
internal ModifiedType(TypeKind kind, Type modifier, Type baseType)
: base(kind.Check(kind.IsModifiedType(), "Not a valid modified type kind", "kind"))
{
if (Kind == TypeKind.ModOpt || Kind == TypeKind.ModReq) {
m_modfier = modifier.CheckNotNull("modifier");
}
else {
m_modfier = modifier.CheckNull("modifier", "A modifier type may only be specified for ModOpt and ModReq types");
}
m_baseType = baseType.CheckNotNull("baseType");
}
开发者ID:scottwis,项目名称:tiny,代码行数:12,代码来源:ModifiedType.cs
示例15: ProjectionCollectionType
internal ProjectionCollectionType(TypeKind kind, Type type, ProjectionFactory factory)
: base(type, kind, factory)
{
// Must register before getting key/item types, due to possible cycles
// Example: A -> IList<B> -> B -> IList<B>
factory.RegisterProjectionType(this);
Type keyType, itemType;
GetSubtypes(out keyType, out itemType);
this.keyType = factory.GetProjectionTypeUnsafe(keyType );
this.itemType = factory.GetProjectionTypeUnsafe(itemType);
}
开发者ID:sharpjs,项目名称:Projector,代码行数:13,代码来源:ProjectionCollectionType.cs
示例16: Resolve
private static IEnumerable<INamedTypeSymbol> Resolve(
SymbolKeyReader reader,
INamespaceOrTypeSymbol container,
string metadataName,
int arity,
TypeKind typeKind,
bool isUnboundGenericType,
ImmutableArray<SymbolKeyResolution> typeArguments)
{
var types = container.GetTypeMembers(GetName(metadataName), arity);
var result = InstantiateTypes(
reader.Compilation, reader.IgnoreAssemblyKey, types, arity, typeArguments);
return isUnboundGenericType
? result.Select(t => t.ConstructUnboundGenericType())
: result;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:17,代码来源:SymbolKey.NamedTypeSymbolKey.cs
示例17: TypeMetadata
public TypeMetadata(string typeName, string @namespace, string csharpName, string scriptName, IReadOnlyList<string> tagNames, bool generate, bool inherit, TypeKind typeKind, bool includeConstructors, IReadOnlyList<TypeOverride> typeOverrides, AstType aliasFor, IEnumerable<Tuple<string, string>> renames, IEnumerable<string> removes, IReadOnlyList<string> addInDerivedTypes, IReadOnlyList<GeneratedEnum> generatedEnums)
{
TypeName = typeName;
Namespace = @namespace;
CSharpName = csharpName;
ScriptName = scriptName;
TagNames = tagNames.AsReadOnlySafe();
Generate = generate && typeKind != TypeKind.Mixin && typeKind != TypeKind.Skip;
Inherit = inherit;
TypeKind = typeKind;
IncludeConstructors = includeConstructors;
TypeOverrides = typeOverrides.AsReadOnlySafe();
AliasFor = aliasFor;
Renames = new ReadOnlyDictionary<string, string>((renames ?? new Tuple<string, string>[0]).ToDictionary(x => x.Item1, x => x.Item2));
Removes = removes.AsReadOnlySafe();
AddInDerivedTypes = addInDerivedTypes.AsReadOnlySafe();
GeneratedEnums = generatedEnums.AsReadOnlySafe();
}
开发者ID:Saltarelle,项目名称:SaltarelleWeb,代码行数:18,代码来源:TypeMetadata.cs
示例18: LambdaFrame
internal LambdaFrame(MethodSymbol topLevelMethod, MethodSymbol containingMethod, bool isStruct, SyntaxNode scopeSyntaxOpt, DebugId methodId, DebugId closureId)
: base(MakeName(scopeSyntaxOpt, methodId, closureId), containingMethod)
{
_typeKind = isStruct ? TypeKind.Struct : TypeKind.Class;
_topLevelMethod = topLevelMethod;
_containingMethod = containingMethod;
_constructor = isStruct ? null : new LambdaFrameConstructor(this);
this.ClosureOrdinal = closureId.Ordinal;
// static lambdas technically have the class scope so the scope syntax is null
if (scopeSyntaxOpt == null)
{
_staticConstructor = new SynthesizedStaticConstructor(this);
var cacheVariableName = GeneratedNames.MakeCachedFrameInstanceFieldName();
_singletonCache = new SynthesizedLambdaCacheFieldSymbol(this, this, cacheVariableName, topLevelMethod, isReadOnly: true, isStatic: true);
}
AssertIsClosureScopeSyntax(scopeSyntaxOpt);
this.ScopeSyntaxOpt = scopeSyntaxOpt;
}
开发者ID:XieShuquan,项目名称:roslyn,代码行数:20,代码来源:LambdaFrame.cs
示例19: CType
public CType(TypeKind k, string typeName)
{
Kind = k;
if (k == TypeKind.Unknown)
return;
if (!string2pt.ContainsKey(typeName))
{
IsPrimitive = false;
// TODO: Search in structures array and throw if not found!
}
else
{
IsPrimitive = true;
Prim = string2pt[typeName];
}
Name = typeName;
}
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:20,代码来源:CType.cs
示例20: VB6UnresolvedTypeDefinition
internal VB6UnresolvedTypeDefinition(IUnresolvedFile file, IVbModule module, IVbpProject project)
: base(file, null)
{
this.Module = module;
_typeKind = this.Module.ToTypeKind();
this.Accessibility = (_typeKind != TypeKind.Module) ? Accessibility.Public : Accessibility.Private;
_events = new List<IUnresolvedEvent>();
_fields = new List<IUnresolvedField>();
_properties = new List<IUnresolvedProperty>();
_methods = new List<IUnresolvedMethod>();
_members = new List<IUnresolvedMember>();
this.DeclaringTypeDefinition = this;
this.FullName = GetName(true);
this.Name = GetName(false);
this.Namespace = "(implicit)";
this.ReflectionName = GetName(true);
ProcessModule();
}
开发者ID:mks786,项目名称:vb6leap,代码行数:23,代码来源:VB6UnresolvedTypeDefinition.cs
注:本文中的TypeKind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论