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


C# IMetadataScope类代码示例

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


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

示例1: StoreExportedType

 internal void StoreExportedType(IMetadataScope scope, String fullName, TypeReference exportedTo)
 {
     if (scope != null)
     {
         exportMappings[GetTypeKey(scope, fullName)] = exportedTo;
     }
 }
开发者ID:peters,项目名称:il-repack,代码行数:7,代码来源:MappingHandler.cs

示例2: Log

 /// <summary>
 /// Add the given message to the log.
 /// </summary>
 private void Log(MessageTypes type, string member, IMetadataScope scope, string msg)
 {
     if (IsDisposed) return;
     if (InvokeRequired)
     {
         Invoke(new Action<MessageTypes, string, IMetadataScope, string>(Log), type, member, scope, msg);
     }
     else
     {
         if ((type >= MessageTypes.MissingFirst) && (type <= MessageTypes.MissingLast))
         {
             MemberNode node;
             if (!nodes.TryGetValue(member, out node))
             {
                 node = new MemberNode(member, scope, type);
                 node.ImageIndex = (int) type;
                 nodes.Add(member, node);
                 tvList.Nodes.Add(node);
             }
             node.Messages.Add(msg);
             if (node == tvList.SelectedNode)
             {
                 tvUsedIn.Nodes.Add(new TreeNode(msg));
             }
         }
         else
         {
             tvLog.Nodes.Add(new TreeNode(msg) { ImageIndex = (int) type });
         }
         miCopy.Enabled = (tvList.Nodes.Count > 0);
     }
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:35,代码来源:MainForm.cs

示例3: ExportedType

 public ExportedType(string @namespace, string name, ModuleDefinition module, IMetadataScope scope)
 {
     [email protected] = @namespace;
     this.name = name;
     this.scope = scope;
     this.module = module;
 }
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:7,代码来源:ExportedType.cs

示例4: GetScopeName

 internal static string GetScopeName(IMetadataScope scope)
 {
     if (scope is AssemblyNameReference)
         return ((AssemblyNameReference)scope).Name;
     if (scope is ModuleDefinition)
         return ((ModuleDefinition) scope).Assembly.Name.Name;
     throw new Exception("Unsupported scope: " + scope);
 }
开发者ID:peters,项目名称:il-repack,代码行数:8,代码来源:MappingHandler.cs

示例5: FindProjectReference

 public ProjectReference FindProjectReference(IMetadataScope scope)
 {
     if (scope == null)
         return null;
     string assemblyFullName = scope.AssemblyFullName();
     return References.FirstOrDefault(
         item => string.
             Equals(item.FullName, assemblyFullName, StringComparison.InvariantCultureIgnoreCase));
 }
开发者ID:MishaUliutin,项目名称:RemoveUnusedRef,代码行数:9,代码来源:IUsedReferencesAuditEntry.cs

示例6: FindType

 public static TypeReference FindType(this ModuleDefinition currentModule, string @namespace, string typeName, IMetadataScope scope = null, params string[] typeParameters)
 {
     var result = new TypeReference(@namespace, typeName, currentModule, scope);
     foreach (var typeParameter in typeParameters)
     {
         result.GenericParameters.Add(new GenericParameter(typeParameter, result));
     }
     return result;
 }
开发者ID:kswoll,项目名称:sexy-react,代码行数:9,代码来源:CecilExtensions.cs

示例7: getModule

        public static MModule getModule(IMetadataScope scope)
        {
            if (scope is ModuleDefinition)
                return getModule((ModuleDefinition)scope);
            else if (scope is AssemblyNameReference)
                return getModule((AssemblyNameReference)scope);

            return null;
        }
开发者ID:Joelone,项目名称:de4dot,代码行数:9,代码来源:Resolver.cs

示例8: GetScopeName

 internal static string GetScopeName(IMetadataScope scope)
 {
     string scopeStr = null;
     if (scope is AssemblyNameReference)
         scopeStr = ((AssemblyNameReference) scope).Name;
     if (scope is ModuleDefinition)
         scopeStr = ((ModuleDefinition) scope).Assembly.Name.Name;
     return scopeStr;
 }
开发者ID:keremkusmezer,项目名称:il-repack,代码行数:9,代码来源:MappingHandler.cs

示例9: GetReference

 private static AssemblyNameReference GetReference(IMetadataScope scope)
 {
     ModuleDefinition definition = scope as ModuleDefinition;
     if (definition != null)
     {
         return definition.Assembly.Name;
     }
     return (AssemblyNameReference) scope;
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:9,代码来源:AssemblyLoader.cs

示例10: GetAssemblyNameReference

 public static AssemblyNameReference GetAssemblyNameReference(IMetadataScope scope)
 {
     switch (scope.MetadataScopeType)
     {
         case MetadataScopeType.AssemblyNameReference:
             return (AssemblyNameReference)scope;
         case MetadataScopeType.ModuleDefinition:
             return ((ModuleDefinition)scope).Assembly.Name;
         default:
             return null;
     }
 }
开发者ID:MishaUliutin,项目名称:RemoveUnusedRef,代码行数:12,代码来源:Helper.cs

示例11: GetAssemblyFromScope

 /// <summary>
 /// Returns the <see cref="AssemblyNameReference"/> associated with the <see cref="IMetadataScope"/>
 /// </summary>
 /// <param name="scope">A <see cref="IMetadataScope"/></param>
 /// <returns>The associated <see cref="AssemblyNameReference"/></returns>
 private static AssemblyNameReference GetAssemblyFromScope(IMetadataScope scope)
 {
     switch (scope.MetadataScopeType)
     {
         case MetadataScopeType.AssemblyNameReference:
             return (AssemblyNameReference)scope;
         case MetadataScopeType.ModuleDefinition:
             return ((ModuleDefinition) scope).Assembly.Name;
         default:
             throw new NotSupportedException();
     }
 }
开发者ID:philiplaureano,项目名称:Hiro,代码行数:17,代码来源:TypeReferenceExtensions.cs

示例12: AreSame

        /// <summary>
        /// Are the given scopes the same?
        /// </summary>
        public static bool AreSame(this IMetadataScope x, IMetadataScope y)
        {
            // Both null?
            if ((x == null) && (y == null)) { return true; }

            // One null, other not null
            if ((x == null) || (y == null)) { return false; }

            var nx = GetName(x);
            var ny = GetName(y);

            return (nx == ny);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:16,代码来源:AreSame.cs

示例13: GetAssemblyNameReference

        static AssemblyNameReference GetAssemblyNameReference(IMetadataScope scope)
        {
            AssemblyNameReference reference;
            if (scope is ModuleDefinition)
            {
                AssemblyDefinition asm = ((ModuleDefinition)scope).Assembly;
                reference = asm.Name;
            }
            else
                reference = (AssemblyNameReference)scope;

            return reference;
        }
开发者ID:Cadla,项目名称:OBFSCTR,代码行数:13,代码来源:ReferencesMapVisitor.cs

示例14: ImportScope

        IMetadataScope ImportScope(IMetadataScope scope)
        {
            switch (scope.MetadataScopeType)
            {
                case MetadataScopeType.AssemblyNameReference:
                    return ImportAssemblyName((AssemblyNameReference)scope);
                case MetadataScopeType.ModuleDefinition:
                    return ImportAssemblyName(((ModuleDefinition)scope).Assembly.Name);
                case MetadataScopeType.ModuleReference:
                    throw new NotImplementedException();
            }

            throw new NotSupportedException();
        }
开发者ID:FreshBirdZhe,项目名称:LSharp,代码行数:14,代码来源:Import.cs

示例15: GetLoggerAdapterMetadataScope

 public IMetadataScope GetLoggerAdapterMetadataScope()
 {
     if (_loggerScope == null)
     {
         //Check if reference to adapter assembly is present. If not, add it (we only look for the name, we assume that different versions are backward compatible)
         var loggerReference = _moduleDefinition.AssemblyReferences.FirstOrDefault(assRef => assRef.Name.Equals(_configuration.AssemblyNameReference.Name));
         if (loggerReference == null)
         {
             loggerReference = _configuration.AssemblyNameReference;
             _moduleDefinition.AssemblyReferences.Add(loggerReference);
         }
         _loggerScope = loggerReference;
     }
     return _loggerScope;
 }
开发者ID:ravibpathuri,项目名称:tracer,代码行数:15,代码来源:ModuleLevelWeaver.cs


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