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


C# TypeSystem.FieldDesc类代码示例

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


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

示例1: GetFieldRvaData

 /// <summary>
 /// Gets an object representing the static data for RVA mapped fields from the PE image.
 /// </summary>
 public ObjectNode GetFieldRvaData(FieldDesc field)
 {
     if (field.GetType() == typeof(Internal.IL.Stubs.PInvokeLazyFixupField))
     {
         var pInvokeFixup = (Internal.IL.Stubs.PInvokeLazyFixupField)field;
         PInvokeMetadata metadata = pInvokeFixup.PInvokeMetadata;
         return NodeFactory.PInvokeMethodFixup(metadata.Module, metadata.Name);
     }
     else
     {
         // Use the typical field definition in case this is an instantiated generic type
         field = field.GetTypicalFieldDefinition();
         return NodeFactory.ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field),
             ((EcmaField)field).GetFieldRvaData(), NodeFactory.Target.PointerSize);
     }
 }
开发者ID:nattress,项目名称:corert,代码行数:19,代码来源:Compilation.cs

示例2: NewToken

 public ILToken NewToken(FieldDesc value)
 {
     return NewToken(value, 0x0a000000);
 }
开发者ID:nguerrera,项目名称:corert,代码行数:4,代码来源:ILEmitter.cs

示例3: GetFieldRvaData

 /// <summary>
 /// Gets an object representing the static data for RVA mapped fields from the PE image.
 /// </summary>
 public object GetFieldRvaData(FieldDesc field)
 {
     return _nodeFactory.ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field),
         ((EcmaField)field).GetFieldRvaData(), _typeSystemContext.Target.PointerSize);
 }
开发者ID:schellap,项目名称:corert,代码行数:8,代码来源:Compilation.cs

示例4: AppendFieldSignature

 private void AppendFieldSignature(StringBuilder sb, FieldDesc field)
 {
     this.TypeNameFormatter.AppendNameWithValueClassPrefix(sb, field.FieldType);
     sb.Append(' ');
     AppendOwningType(sb, field.OwningType);
     sb.Append("::");
     sb.Append(field.Name);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:8,代码来源:ILDisassember.cs

示例5: ComputeHasGCStaticBase

        protected override bool ComputeHasGCStaticBase(FieldDesc field)
        {
            Debug.Assert(field.IsStatic);

            TypeDesc fieldType = field.FieldType;
            if (fieldType.IsValueType)
                return ((DefType)fieldType).ContainsGCPointers;
            else
                return fieldType.IsGCPointer;

        }
开发者ID:krytarowski,项目名称:corert,代码行数:11,代码来源:TestTypeSystemContext.cs

示例6: GetMangledFieldName

        public string GetMangledFieldName(FieldDesc field)
        {
            string mangledName;
            if (_mangledFieldNames.TryGetValue(field, out mangledName))
                return mangledName;

            return ComputeMangledFieldName(field);
        }
开发者ID:tijoytom,项目名称:corert,代码行数:8,代码来源:NameMangler.cs

示例7: GetFieldTypeOrPlaceholder

 private TypeDesc GetFieldTypeOrPlaceholder(FieldDesc field)
 {
     try
     {
         return field.FieldType;
     }
     catch
     {
         // TODO: For now, catch errors due to missing dependencies
         return _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.Boolean);
     }
 }
开发者ID:justinvp,项目名称:corert,代码行数:12,代码来源:CppWriter.cs

示例8: GetCppFieldName

 public string GetCppFieldName(FieldDesc field)
 {
     return _compilation.NameMangler.GetMangledFieldName(field).ToString();
 }
开发者ID:justinvp,项目名称:corert,代码行数:4,代码来源:CppWriter.cs

示例9: RvaFieldData

 public RvaFieldData(Compilation compilation, FieldDesc field)
 {
     Debug.Assert(field.HasRva);
     Field = field;
     _compilation = compilation;
 }
开发者ID:niemyjski,项目名称:corert,代码行数:6,代码来源:RvaFieldData.cs

示例10: GeneratesMetadata

 public bool GeneratesMetadata(FieldDesc fieldDef)
 {
     return GeneratesMetadata((MetadataType)fieldDef.OwningType);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:4,代码来源:MultifileMetadataPolicy.cs

示例11: AddField

        public void AddField(FieldDesc field)
        {
            RegisteredField reg = GetRegisteredField(field);
            if (reg.IncludedInCompilation)
                return;
            reg.IncludedInCompilation = true;

            if (_options.IsCppCodeGen)
            {
                // Precreate name to ensure that all types referenced by signatures are present
                GetRegisteredType(field.OwningType);
                GetRegisteredType(field.FieldType);
            }
        }
开发者ID:AustinWise,项目名称:corert,代码行数:14,代码来源:Compilation.cs

示例12: GetRegisteredField

        internal RegisteredField GetRegisteredField(FieldDesc field)
        {
            RegisteredField existingRegistration;
            if (_registeredFields.TryGetValue(field, out existingRegistration))
                return existingRegistration;

            RegisteredField registration = new RegisteredField() { Field = field };
            _registeredFields.Add(field, registration);

            GetRegisteredType(field.OwningType);

            return registration;
        }
开发者ID:AustinWise,项目名称:corert,代码行数:13,代码来源:Compilation.cs

示例13: FieldForInstantiatedType

 internal FieldForInstantiatedType(FieldDesc fieldDef, InstantiatedType instantiatedType)
 {
     _fieldDef = fieldDef;
     _instantiatedType = instantiatedType;
 }
开发者ID:tijoytom,项目名称:corert,代码行数:5,代码来源:FieldForInstantiatedType.cs

示例14: AddFieldReference

        private void AddFieldReference(FieldDesc field)
        {
            if (field.IsStatic)
            {
                var owningType = (MetadataType)field.OwningType;

                Object node;
                if (field.IsThreadStatic)
                {
                    node = _nodeFactory.TypeThreadStaticsSymbol(owningType);
                }
                else
                {
                    if (field.HasGCStaticBase)
                        node = _nodeFactory.TypeGCStaticsSymbol(owningType);
                    else
                        node = _nodeFactory.TypeNonGCStaticsSymbol(owningType);
                }

                // TODO: Remove once the depedencies for static fields are tracked properly
                _writer.GetCppSignatureTypeName(owningType);

                _dependencies.Add(node);
            }
        }
开发者ID:nguerrera,项目名称:corert,代码行数:25,代码来源:ILToCppImporter.cs

示例15: GeneratesMetadata

 public bool GeneratesMetadata(FieldDesc fieldDef)
 {
     if (_fieldGeneratesMetadata != null)
         return _fieldGeneratesMetadata(fieldDef);
     return false;
 }
开发者ID:tijoytom,项目名称:corert,代码行数:6,代码来源:MockPolicy.cs


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