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


C# Namespace.AddMember方法代码示例

本文整理汇总了C#中Namespace.AddMember方法的典型用法代码示例。如果您正苦于以下问题:C# Namespace.AddMember方法的具体用法?C# Namespace.AddMember怎么用?C# Namespace.AddMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Namespace的用法示例。


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

示例1: LoadTypesInNamespace

 //  Caller must take lock on this
 internal void LoadTypesInNamespace(
   Namespace moduleNamespace
 )
   //^ requires moduleNamespace.NamespaceNameOffset != 0xFFFFFFFF;
 {
   CoreTypes dummy = this.CoreTypes; //force core types to be initialized
   uint namespaceNameOffset = moduleNamespace.NamespaceNameOffset;
   Debug.Assert(namespaceNameOffset != 0xFFFFFFFF);
   uint numberOfTypeDefs = this.PEFileReader.TypeDefTable.NumberOfRows;
   var moduleTypeArray = this.ModuleTypeDefArray;
   for (uint i = 1; i <= numberOfTypeDefs; ++i) {
     TypeDefRow typeDefRow = this.PEFileReader.TypeDefTable[i];
     //  Check if its in the same namespace
     if (typeDefRow.Namespace != namespaceNameOffset || typeDefRow.IsNested)
       continue;
     //  Check if its already created by someone else
     NamespaceType/*?*/ type = (NamespaceType)moduleTypeArray[i];
     if (type == null) {
       type = this.CreateModuleNamespaceType(i, typeDefRow, moduleNamespace, MetadataReaderSignatureTypeCode.NotModulePrimitive);
       var redirectedType = this.ModuleReader.metadataReaderHost.Redirect(this.Module, type);
       if (redirectedType == type) moduleNamespace.AddMember(type);
       moduleTypeArray[i] = type;
       this.RedirectedTypeDefArray[i] = redirectedType;
       this.ModuleTypeDefLoadState[i] = LoadState.Loaded;
     }
   }
   uint numberOfExportedTypes = this.PEFileReader.ExportedTypeTable.NumberOfRows;
   ExportedTypeAliasBase/*?*/[] exportedTypeArray = this.ExportedTypeArray;
   for (uint i = 1; i <= numberOfExportedTypes; ++i) {
     ExportedTypeRow exportedTypeRow = this.PEFileReader.ExportedTypeTable[i];
     //  Check if its in the same namespace
     if (exportedTypeRow.TypeNamespace != namespaceNameOffset || exportedTypeRow.IsNested)
       continue;
     //  Check if its already created by someone else
     ExportedTypeAliasBase/*?*/ type = exportedTypeArray[i];
     if (type == null) {
       type = this.CreateExportedNamespaceType(i, exportedTypeRow, moduleNamespace);
       this.ExportedTypeArray[i] = type;
       this.ExportedTypeLoadState[i] = LoadState.Loaded;
     }
   }
 }
开发者ID:Biegal,项目名称:Afterthought,代码行数:43,代码来源:PEFileToObjectModel.cs

示例2: CreateModuleNamespaceType

 NamespaceType CreateModuleNamespaceType(
   uint typeDefRowId,
   TypeDefRow typeDefRow,
   Namespace moduleNamespace,
   ModuleSignatureTypeCode signatureTypeCode
 ) {
   IName typeName = this.GetNameFromOffset(typeDefRow.Name);
   uint genericParamRowIdStart;
   uint genericParamRowIdEnd;
   this.GetGenericParamInfoForType(typeDefRowId, out genericParamRowIdStart, out genericParamRowIdEnd);
   NamespaceType type;
   if (genericParamRowIdStart == 0) {
     if (signatureTypeCode == ModuleSignatureTypeCode.NotModulePrimitive)
       type = new NonGenericNamespaceTypeWithoutPrimitiveType(this, typeName, typeDefRowId, typeDefRow.Flags, moduleNamespace);
     else
       type = new NonGenericNamespaceTypeWithPrimitiveType(this, typeName, typeDefRowId, typeDefRow.Flags, moduleNamespace, signatureTypeCode);
   } else {
     IName unmangledTypeName = this.GetUnmangledNameFromOffset(typeDefRow.Name);
     type = new GenericNamespaceType(this, unmangledTypeName, typeDefRowId, typeDefRow.Flags, moduleNamespace, typeName, genericParamRowIdStart, genericParamRowIdEnd);
   }
   moduleNamespace.AddMember(type);
   return type;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:23,代码来源:PEFileToObjectModel.cs

示例3: CreateExportedNamespaceType

 ExportedTypeNamespaceAlias CreateExportedNamespaceType(
   uint exportedTypeRowId,
   ExportedTypeRow exportedTypeRow,
   Namespace moduleNamespace
 ) {
   IName typeName = this.GetNameFromOffset(exportedTypeRow.TypeName);
   ExportedTypeNamespaceAlias exportedType = new ExportedTypeNamespaceAlias(this, typeName, exportedTypeRowId, exportedTypeRow.Flags, moduleNamespace);
   moduleNamespace.AddMember(exportedType);
   return exportedType;
 }
开发者ID:Biegal,项目名称:Afterthought,代码行数:10,代码来源:PEFileToObjectModel.cs

示例4: CreateExportedNamespaceType

 ExportedTypeNamespaceAlias CreateExportedNamespaceType(uint exportedTypeRowId, ExportedTypeRow exportedTypeRow, Namespace moduleNamespace) {
   ExportedTypeNamespaceAlias exportedType = new ExportedTypeNamespaceAlias(this, exportedTypeRowId, exportedTypeRow.Flags, moduleNamespace);
   moduleNamespace.AddMember(exportedType);
   return exportedType;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:5,代码来源:PEFileToObjectModel.cs


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