当前位置: 首页>>代码示例>>C#>>正文


C# TypeKind类代码示例

本文整理汇总了C#中TypeKind的典型用法代码示例。如果您正苦于以下问题:C# TypeKind类的具体用法?C# TypeKind怎么用?C# TypeKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TypeKind类属于命名空间,在下文中一共展示了TypeKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的TypeKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。