• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TypeFlags类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: MarkValueType

		internal Type MarkValueType()
		{
			typeFlags |= TypeFlags.ValueType;
			return this;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:5,代码来源:Type.cs


示例17: TypeDesc

 internal TypeDesc(string name, string fullName, XmlSchemaType dataType, TypeKind kind, TypeDesc baseTypeDesc, TypeFlags flags, string formatterName)
 {
     _name = name.Replace('+', '.');
     _fullName = fullName.Replace('+', '.');
     _kind = kind;
     _baseTypeDesc = baseTypeDesc;
     _flags = flags;
     _isXsdType = kind == TypeKind.Primitive;
     if (_isXsdType)
         _weight = 1;
     else if (kind == TypeKind.Enum)
         _weight = 2;
     else if (_kind == TypeKind.Root)
         _weight = -1;
     else
         _weight = baseTypeDesc == null ? 0 : baseTypeDesc.Weight + 1;
     _dataType = dataType;
     _formatterName = formatterName;
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:19,代码来源:Types.cs


示例18: GetTypeDesc

 internal TypeDesc GetTypeDesc(string name, string ns, TypeFlags flags)
 {
     TypeDesc typeDesc = (TypeDesc)s_primitiveNames[name, ns];
     if (typeDesc != null)
     {
         if ((typeDesc.Flags & flags) != 0)
         {
             return typeDesc;
         }
     }
     return null;
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:12,代码来源:Types.cs


示例19: AddNonXsdPrimitive

 private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags)
 {
     XmlSchemaSimpleType dataType = new XmlSchemaSimpleType();
     dataType.Name = dataTypeName;
     TypeDesc typeDesc = new TypeDesc(type, false, dataType, formatterName, flags);
     if (s_primitiveTypes[type] == null)
         s_primitiveTypes.Add(type, typeDesc);
     s_primitiveDataTypes.Add(dataType, typeDesc);
     s_primitiveNames.Add(dataTypeName, ns, typeDesc);
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:10,代码来源:Types.cs


示例20: AddPrimitive

 private static void AddPrimitive(Type type, string dataTypeName, string formatterName, TypeFlags flags)
 {
     XmlSchemaSimpleType dataType = new XmlSchemaSimpleType();
     dataType.Name = dataTypeName;
     TypeDesc typeDesc = new TypeDesc(type, true, dataType, formatterName, flags);
     if (s_primitiveTypes[type] == null)
         s_primitiveTypes.Add(type, typeDesc);
     s_primitiveDataTypes.Add(dataType, typeDesc);
     s_primitiveNames.Add(dataTypeName, XmlSchema.Namespace, typeDesc);
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:10,代码来源:Types.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TypeInfo类代码示例发布时间:2022-05-24
下一篇:
C# TypeFilter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap