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


C# TypeFlags类代码示例

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


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

示例1: Init

        public void Init(string fullName, int flags, JsTypeFunction thisType, JsTypeFunction baseType, JsTypeFunction[] interfaces, JsTypeFunction[] typeArguments, FieldInfo[] fields, MethodInfo[] methods, ConstructorInfo[] constructors, PropertyInfo[] properties, EventInfo[] events, JsTypeFunction elementType, JsTypeFunction unconstructedType)
        {
            FullName = fullName;

            typeFlags = (TypeFlags)flags;

//            this.typeAttributes = typeAttributes;
            this.thisType = thisType;
            this.baseType = baseType;
            this.interfaces = interfaces;
            this.typeArguments = typeArguments;
            this.fields = fields ?? new FieldInfo[0];
            this.methods = methods ?? new MethodInfo[0];
            this.properties = properties ?? new PropertyInfo[0];
            this.constructors = constructors ?? new ConstructorInfo[0];
            this.events = events ?? new EventInfo[0];
            this.elementType = elementType;
            this.unconstructedType = unconstructedType;

            foreach (var field in this.fields)
                field.declaringType = this;
            foreach (var method in this.methods)
                method.declaringType = this;
            foreach (var property in this.properties)
            {
                property.declaringType = this;
                if (property.GetMethod != null)
                    property.GetMethod.declaringType = this;
                if (property.SetMethod != null)
                    property.SetMethod.declaringType = this;
            }
            foreach (var constructor in this.constructors)
                constructor.declaringType = this;
        }
开发者ID:MarkStega,项目名称:WootzJs,代码行数:34,代码来源:Type.cs

示例2: GetDefaultMapping

 internal TypeMapping GetDefaultMapping(TypeFlags flags) {
     PrimitiveMapping mapping = new PrimitiveMapping();
     mapping.TypeDesc = Scope.GetTypeDesc("string", XmlSchema.Namespace, flags);
     mapping.TypeName = mapping.TypeDesc.DataType.Name;
     mapping.Namespace = XmlSchema.Namespace;
     return mapping;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:XmlSchemaImporter.cs

示例3: 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

示例4: ComputeTypeFlags

 protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
 {
     // We might be able to compute the type flags for some masks, but for some this will always throw (e.g.
     // Category and GenericVariance should always throw). If you hit an exception, it means you need a
     // special case for IsSignatureVariable.
     throw new NotImplementedException();
 }
开发者ID:shahid-pk,项目名称:corert,代码行数:7,代码来源:SignatureVariable.cs

示例5: ComputeTypeFlags

 protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
 {
     return TypeFlags.Class |
         TypeFlags.ContainsGenericVariablesComputed |
         TypeFlags.HasGenericVarianceComputed |
         TypeFlags.HasStaticConstructorComputed;
 }
开发者ID:justinvp,项目名称:corert,代码行数:7,代码来源:CompilerGeneratedType.cs

示例6: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = TypeFlags.FunctionPointer;

            if ((mask & TypeFlags.ContainsGenericVariablesComputed) != 0)
            {
                flags |= TypeFlags.ContainsGenericVariablesComputed;

                if (_signature.ReturnType.ContainsGenericVariables)
                    flags |= TypeFlags.ContainsGenericVariables;
                else
                {
                    for (int i = 0; i < _signature.Length; i++)
                    {
                        if (_signature[i].ContainsGenericVariables)
                        {
                            flags |= TypeFlags.ContainsGenericVariables;
                            break;
                        }
                    }
                }
            }

            flags |= TypeFlags.HasGenericVarianceComputed;

            return flags;
        }
开发者ID:krytarowski,项目名称:corert,代码行数:27,代码来源:FunctionPointerType.cs

示例7: CheckNeedConstructor

 internal void CheckNeedConstructor()
 {
     if ((!this.IsValueType && !this.IsAbstract) && !this.HasDefaultConstructor)
     {
         this.flags |= TypeFlags.Unsupported;
         this.exception = new InvalidOperationException(Res.GetString("XmlConstructorInaccessible", new object[] { this.FullName }));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TypeDesc.cs

示例8: 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

示例9: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = 0;

            flags |= TypeFlags.ContainsGenericVariablesComputed | TypeFlags.ContainsGenericVariables;

            flags |= TypeFlags.GenericParameter;

            return flags;
        }
开发者ID:niemyjski,项目名称:corert,代码行数:10,代码来源:EcmaGenericParameter.cs

示例10: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = 0;

            if ((mask & TypeFlags.CategoryMask) != 0)
            {
                flags |= TypeFlags.SignatureTypeVariable;
            }

            return flags;
        }
开发者ID:hoyMS,项目名称:corert,代码行数:11,代码来源:SignatureVariable.cs

示例11: AddPrimitive

 private static void AddPrimitive(Type type, string dataTypeName, string formatterName, TypeFlags flags)
 {
     XmlSchemaSimpleType dataType = new XmlSchemaSimpleType {
         Name = dataTypeName
     };
     TypeDesc desc = new TypeDesc(type, true, dataType, formatterName, flags);
     if (primitiveTypes[type] == null)
     {
         primitiveTypes.Add(type, desc);
     }
     primitiveDataTypes.Add(dataType, desc);
     primitiveNames.Add(dataTypeName, "http://www.w3.org/2001/XMLSchema", desc);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:TypeScope.cs

示例12: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = 0;

            flags |= TypeFlags.ContainsGenericVariablesComputed | TypeFlags.ContainsGenericVariables;

            flags |= TypeFlags.GenericParameter;

            flags |= TypeFlags.HasGenericVarianceComputed;

            Debug.Assert((flags & mask) != 0);
            return flags;
        }
开发者ID:tijoytom,项目名称:corert,代码行数:13,代码来源:EcmaGenericParameter.cs

示例13: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = TypeFlags.ByRef;

            if ((mask & TypeFlags.ContainsGenericVariablesComputed) != 0)
            {
                flags |= TypeFlags.ContainsGenericVariablesComputed;
                if (this.ParameterType.ContainsGenericVariables)
                    flags |= TypeFlags.ContainsGenericVariables;
            }

            return flags;
        }
开发者ID:huamichaelchen,项目名称:corert,代码行数:13,代码来源:ByRefType.cs

示例14: ComputeTypeFlags

        protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
        {
            TypeFlags flags = 0;

            if ((mask & TypeFlags.CategoryMask) != 0)
            {
                flags |= TypeFlags.SignatureTypeVariable;
            }

            // Not all masks are valid to ask on signature variables. If you hit this assert, you might
            // need to special case, or you have a bug.
            Debug.Assert((flags & mask) != 0);
            return flags;
        }
开发者ID:tijoytom,项目名称:corert,代码行数:14,代码来源:SignatureVariable.cs

示例15: AddNonXsdPrimitive

 private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags)
 {
     XmlSchemaSimpleType dataType = new XmlSchemaSimpleType {
         Name = dataTypeName
     };
     XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction {
         BaseTypeName = baseTypeName
     };
     foreach (XmlSchemaFacet facet in facets)
     {
         restriction.Facets.Add(facet);
     }
     dataType.Content = restriction;
     TypeDesc desc = new TypeDesc(type, false, dataType, formatterName, flags);
     if (primitiveTypes[type] == null)
     {
         primitiveTypes.Add(type, desc);
     }
     primitiveDataTypes.Add(dataType, desc);
     primitiveNames.Add(dataTypeName, ns, desc);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:TypeScope.cs


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