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

C# INameTable类代码示例

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

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



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

示例1: FirstStatementIsIteratorCreation

 private static IMethodBody/*?*/ FirstStatementIsIteratorCreation(IMetadataHost host, ISourceMethodBody possibleIterator, INameTable nameTable, IStatement statement) {
   ICreateObjectInstance createObjectInstance = GetICreateObjectInstance(statement);
   if (createObjectInstance == null) {
     // If the first statement in the method body is not the creation of iterator closure, return a dummy.
     // Possible corner case not handled: a local is used to hold the constant value for the initial state of the closure.
     return null;
   }
   ITypeReference closureType/*?*/ = createObjectInstance.MethodToCall.ContainingType;
   ITypeReference unspecializedClosureType = ContractHelper.Unspecialized(closureType);
   if (!AttributeHelper.Contains(unspecializedClosureType.Attributes, host.PlatformType.SystemRuntimeCompilerServicesCompilerGeneratedAttribute))
     return null;
   INestedTypeReference closureTypeAsNestedTypeReference = unspecializedClosureType as INestedTypeReference;
   if (closureTypeAsNestedTypeReference == null) return null;
   ITypeReference unspecializedClosureContainingType = ContractHelper.Unspecialized(closureTypeAsNestedTypeReference.ContainingType);
   if (closureType != null && TypeHelper.TypesAreEquivalent(possibleIterator.MethodDefinition.ContainingTypeDefinition, unspecializedClosureContainingType)) {
     IName MoveNextName = nameTable.GetNameFor("MoveNext");
     foreach (ITypeDefinitionMember member in closureType.ResolvedType.GetMembersNamed(MoveNextName, false)) {
       IMethodDefinition moveNext = member as IMethodDefinition;
       if (moveNext != null) {
         ISpecializedMethodDefinition moveNextGeneric = moveNext as ISpecializedMethodDefinition;
         if (moveNextGeneric != null)
           moveNext = moveNextGeneric.UnspecializedVersion.ResolvedMethod;
         return moveNext.Body;
       }
     }
   }
   return null;
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:28,代码来源:MoveNext.cs


示例2: HostEnvironment

 public HostEnvironment(INameTable table, IEnumerable<String> assemblyPaths, IEnumerable<String> referencedAssemblies)
     : base(table, new InternFactory(), 4, assemblyPaths, true)
 {
     _peReader = new PeReader(this);
     _assemblyPaths = assemblyPaths;
     _referencedAssemblies = referencedAssemblies;
 }
开发者ID:dsgouda,项目名称:buildtools,代码行数:7,代码来源:HostEnvironment.cs


示例3: MetadataHostEnvironment

 /// <summary>
 /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
 /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
 /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
 /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
 /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
 /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
 /// </param>
 /// <param name="factory">The intern factory to use when generating keys. When comparing two or more assemblies using
 /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.</param>
 protected MetadataHostEnvironment(INameTable nameTable, IInternFactory factory, byte pointerSize)
   //^ requires pointerSize == 0 || pointerSize == 4 || pointerSize == 8;
 {
   this.nameTable = nameTable;
   this.internFactory = factory;
   this.pointerSize = pointerSize;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:24,代码来源:Core.cs


示例4: MetadataHostEnvironment

 /// <summary>
 /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="factory">
 /// The intern factory to use when generating keys. When comparing two or more assemblies using
 /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.
 /// </param>
 /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
 /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
 /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
 /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
 /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
 /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
 /// </param>
 /// <param name="searchPaths">
 /// A collection of strings that are interpreted as valid paths which are used to search for units.
 /// </param>
 /// <param name="searchInGAC">
 /// Whether the GAC (Global Assembly Cache) should be searched when resolving references.
 /// </param>
 protected MetadataHostEnvironment(INameTable nameTable, IInternFactory factory, byte pointerSize, IEnumerable<string> searchPaths, bool searchInGAC)
   //^ requires pointerSize == 0 || pointerSize == 4 || pointerSize == 8;
 {
   this.nameTable = nameTable;
   this.internFactory = factory;
   this.pointerSize = pointerSize;
   this.libPaths = searchPaths == null ? new List<string>(0) : new List<string>(searchPaths);
   this.SearchInGAC = searchInGAC;
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:34,代码来源:Core.cs


示例5: MetadataHostEnvironment

    /// <summary>
    /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
    /// </summary>
    /// <param name="nameTable">
    /// A collection of IName instances that represent names that are commonly used during compilation.
    /// This is a provided as a parameter to the host environment in order to allow more than one host
    /// environment to co-exist while agreeing on how to map strings to IName instances.
    /// </param>
    /// <param name="factory">
    /// The intern factory to use when generating keys. When comparing two or more assemblies using
    /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.
    /// </param>
    /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
    /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
    /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
    /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
    /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
    /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
    /// </param>
    /// <param name="searchPaths">
    /// A collection of strings that are interpreted as valid paths which are used to search for units. May be null.
    /// </param>
    /// <param name="searchInGAC">
    /// Whether the GAC (Global Assembly Cache) should be searched when resolving references.
    /// </param>
    protected MetadataHostEnvironment(INameTable nameTable, IInternFactory factory, byte pointerSize, IEnumerable<string>/*?*/ searchPaths, bool searchInGAC) {
      Contract.Requires(nameTable != null);
      Contract.Requires(factory != null);
      Contract.Requires(pointerSize == 0 || pointerSize == 4 || pointerSize == 8);

      this.nameTable = nameTable;
      this.internFactory = factory;
      this.pointerSize = pointerSize;
      this.libPaths = searchPaths == null ? new List<string>(0) : new List<string>(searchPaths);
      this.SearchInGAC = searchInGAC;
    }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:36,代码来源:Core.cs


示例6: Parse

        public static AssemblyIdentity Parse(INameTable nameTable, string formattedName)
        {
            var name = new System.Reflection.AssemblyName(formattedName);
            return new AssemblyIdentity(nameTable.GetNameFor(name.Name),
                                        name.CultureName,
                                        name.Version,
                                        name.GetPublicKeyToken(),
#if COREFX
                                        "");
#else
                                        name.CodeBase);
#endif
        }
开发者ID:jango2015,项目名称:buildtools,代码行数:13,代码来源:AssemblyIdentityHelpers.cs


示例7: Inherited

 /// <summary>
 /// Specifies whether this attribute applies to derived types and/or overridden methods.
 /// This information is obtained from an attribute on the attribute type definition.
 /// </summary>
 public static bool Inherited(ITypeDefinition attributeType, INameTable nameTable) {
   foreach (ICustomAttribute ca in attributeType.Attributes) {
     if (!TypeHelper.TypesAreEquivalent(ca.Type, attributeType.PlatformType.SystemAttributeUsageAttribute))
       continue;
     foreach (IMetadataNamedArgument namedArgument in ca.NamedArguments) {
       if (namedArgument.ArgumentName.UniqueKey == nameTable.AllowMultiple.UniqueKey) {
         IMetadataConstant/*?*/ compileTimeConst = namedArgument.ArgumentValue as IMetadataConstant;
         if (compileTimeConst == null || compileTimeConst.Value == null || !(compileTimeConst.Value is bool))
           continue;
         //^ assume false; //Unboxing cast might fail
         return (bool)compileTimeConst.Value;
       }
     }
   }
   return false;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:20,代码来源:AttributeHelper.cs


示例8: NamespaceTypeName

 internal NamespaceTypeName(INameTable nameTable, NamespaceName/*?*/ namespaceName, IName name) {
   this.NamespaceName = namespaceName;
   this.Name = name;
   string nameStr = null;
   TypeCache.SplitMangledTypeName(name.Value, out nameStr, out this.genericParameterCount);
   if (this.genericParameterCount > 0)
     this.unmanagledTypeName = nameTable.GetNameFor(nameStr);
   else
     this.unmanagledTypeName = name;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:10,代码来源:Attributes.cs


示例9: NamespaceName

 internal NamespaceName(INameTable nameTable, NamespaceName/*?*/ parentNamespaceName, IName name) {
   this.ParentNamespaceName = parentNamespaceName;
   this.Name = name;
   if (parentNamespaceName == null)
     this.FullyQualifiedName = name;
   else
     this.FullyQualifiedName = nameTable.GetNameFor(parentNamespaceName.FullyQualifiedName.Value + "." + name);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:8,代码来源:Attributes.cs


示例10: MetadataReaderHost

 /// <summary>
 /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="factory">The intern factory to use when generating keys. When comparing two or more assemblies using
 /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.</param>
 /// /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
 /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
 /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
 /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
 /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
 /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
 /// </param>
 protected MetadataReaderHost(INameTable nameTable, IInternFactory factory, byte pointerSize)
   : base(nameTable, factory, pointerSize)
   //^ requires pointerSize == 0 || pointerSize == 4 || pointerSize == 8;
 {
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:22,代码来源:Core.cs


示例11: NestedTypeName

 internal NestedTypeName(INameTable nameTable, NominalTypeName containingTypeName, IName mangledName) {
   this.ContainingTypeName = containingTypeName;
   this.Name = mangledName;
   string nameStr = null;
   TypeCache.SplitMangledTypeName(mangledName.Value, out nameStr, out this.genericParameterCount);
   this.unmangledTypeName = nameTable.GetNameFor(nameStr);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:7,代码来源:Attributes.cs


示例12: DefaultHost

 /// <summary>
 /// Allocates a simple host environment using default settings inherited from MetadataReaderHost and that
 /// uses PeReader as its metadata reader.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 public DefaultHost(INameTable nameTable)
   : base(nameTable) {
   this.peReader = new PeReader(this);
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:13,代码来源:ModuleReadWriteFactory.cs


示例13: AssertAssumeAdderVisitor

 /// <summary>
 /// Allocates a visitor that traverses a code model and generates explicit assert and assume statements based on implicit checks and assumptions
 /// that are present in the object model. For example, any array index expression implicitly asserts that the array index is within bounds.
 /// The purpose of this visitor is to produce an object model that can be checked by a static checker, without requiring the static checker to
 /// have special cases for all of the implicit assertions and assumes in the code.
 /// </summary>
 /// <param name="nameTable">A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.</param>
 /// <param name="insertAssumeFalseAtLine"></param>
 public AssertAssumeAdderVisitor(INameTable nameTable, uint? insertAssumeFalseAtLine)
     : base()
 {
     this.nameTable = nameTable;
       this.insertAssumeFalseAtLine = insertAssumeFalseAtLine;
 }
开发者ID:riverar,项目名称:devtools,代码行数:16,代码来源:AssertionAdderVisitor.cs


示例14: DefaultHost

 /// <summary>
 /// Allocates a simple host environment using default settings inherited from MetadataReaderHost and that
 /// uses PeReader as its metadata reader.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 public DefaultHost(INameTable nameTable)
     : base(nameTable, new InternFactory(), 0, null, false)
 {
     this.peReader = new PeReader(this);
 }
开发者ID:nithinphilips,项目名称:Afterthought,代码行数:14,代码来源:ModuleReadWriteFactory.cs


示例15: ILGeneratorScope

 internal ILGeneratorScope(uint offset, INameTable nameTable, IMethodDefinition containingMethod)
 {
     this.offset = offset;
       this.nameTable = nameTable;
       this.methodDefinition = containingMethod;
 }
开发者ID:harib,项目名称:Afterthought,代码行数:6,代码来源:ILGenerator.cs


示例16: GetNamespaceName

 private NamespaceName/*?*/ GetNamespaceName(INameTable nameTable, INestedUnitNamespaceReference/*?*/ nestedUnitNamespaceReference) {
   if (nestedUnitNamespaceReference == null) return null;
   var parentNamespaceName = this.GetNamespaceName(nameTable, nestedUnitNamespaceReference.ContainingUnitNamespace as INestedUnitNamespaceReference);
   return new NamespaceName(nameTable, parentNamespaceName, nestedUnitNamespaceReference.Name);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:5,代码来源:Attributes.cs


示例17: TypeNameParser

 internal TypeNameParser(
   INameTable nameTable,
   string typeName
 ) {
   this.NameTable = nameTable;
   this.TypeName = typeName;
   this.Length = typeName.Length;
   this.Version = nameTable.GetNameFor("Version");
   this.Retargetable = nameTable.GetNameFor("Retargetable");
   this.PublicKeyToken = nameTable.GetNameFor("PublicKeyToken");
   this.Culture = nameTable.GetNameFor("Culture");
   this.neutral = nameTable.GetNameFor("neutral");
   this.CurrentIdentifierInfo = nameTable.EmptyName;
   this.NextToken(false);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:15,代码来源:Attributes.cs


示例18: MetadataReaderHost

 /// <summary>
 /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
 /// Remember to call the Dispose method when the resulting object is no longer needed.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="factory">
 /// The intern factory to use when generating keys. When comparing two or more assemblies using
 /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.
 /// </param>
 /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
 /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
 /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
 /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
 /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
 /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
 /// </param>
 /// <param name="searchPaths">
 /// A collection of strings that are interpreted as valid paths which are used to search for units.
 /// </param>
 /// <param name="searchInGAC">
 /// Whether the GAC (Global Assembly Cache) should be searched when resolving references.
 /// </param>
 protected MetadataReaderHost(INameTable nameTable, IInternFactory factory, byte pointerSize, IEnumerable<string> searchPaths, bool searchInGAC)
   : base(nameTable, factory, pointerSize, searchPaths, searchInGAC) {
   Contract.Requires(pointerSize == 0 || pointerSize == 4 || pointerSize == 8);
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:30,代码来源:Core.cs


示例19: DefaultWindowsRuntimeHost

 /// <summary>
 /// Allocates a simple host environment using default settings inherited from MetadataReaderHost and that
 /// uses PeReader as its metadata reader.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="projectToCLRTypes">True if the host should project references to certain Windows Runtime types and methods
 /// to corresponding CLR types and methods, in order to emulate the runtime behavior of the CLR.</param>
 public DefaultWindowsRuntimeHost(INameTable nameTable, bool projectToCLRTypes = true)
   : base(nameTable, new InternFactory(), 0, null, false, projectToCLRTypes) {
   this.peReader = new PeReader(this);
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:15,代码来源:WindowsRuntimeHost.cs


示例20: SourceEditHostEnvironment

 /// <summary>
 /// Allocates an object that provides an abstraction over the application hosting compilers based on this framework.
 /// </summary>
 /// <param name="nameTable">
 /// A collection of IName instances that represent names that are commonly used during compilation.
 /// This is a provided as a parameter to the host environment in order to allow more than one host
 /// environment to co-exist while agreeing on how to map strings to IName instances.
 /// </param>
 /// <param name="factory">
 /// The intern factory to use when generating keys. When comparing two or more assemblies using
 /// TypeHelper, MemberHelper, etc. it is necessary to make the hosts use the same intern factory.
 /// </param>
 /// <param name="pointerSize">The size of a pointer on the runtime that is the target of the metadata units to be loaded
 /// into this metadta host. This parameter only matters if the host application wants to work out what the exact layout
 /// of a struct will be on the target runtime. The framework uses this value in methods such as TypeHelper.SizeOfType and
 /// TypeHelper.TypeAlignment. If the host application does not care about the pointer size it can provide 0 as the value
 /// of this parameter. In that case, the first reference to IMetadataHost.PointerSize will probe the list of loaded assemblies
 /// to find an assembly that either requires 32 bit pointers or 64 bit pointers. If no such assembly is found, the default is 32 bit pointers.
 /// </param>
 /// <param name="searchPaths">
 /// A collection of strings that are interpreted as valid paths which are used to search for units.
 /// </param>
 /// <param name="searchInGAC">
 /// Whether the GAC (Global Assembly Cache) should be searched when resolving references.
 /// </param>
 protected SourceEditHostEnvironment(INameTable nameTable, IInternFactory factory, byte pointerSize, IEnumerable<string> searchPaths, bool searchInGAC)
   : base(nameTable, factory, pointerSize, searchPaths, searchInGAC)
   //^ requires pointerSize == 0 || pointerSize == 4 || pointerSize == 8;
 {
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:30,代码来源:Implementations.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# INamedBlockVariable类代码示例发布时间:2022-05-24
下一篇:
C# INameService类代码示例发布时间: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