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

C# IMetadataScope类代码示例

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

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



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


示例16: Import

        internal TypeReference Import(ModuleDefinition module, IMetadataScope scope, IInjector injector)
        {
            var reference = new TypeReference(
                ParentType == null ? Attr.Namespace : "",
                InjecteeType.Name,
                module,
                module.ImportScope(injector.MapMetadataScope(scope)),
                InjecteeType.IsValueType);

            MetadataSystem.TryProcessPrimitiveTypeReference(reference);

            if (ParentType != null)
            {
                var declDef = module.FindMatchingType(ParentType, true);
                reference.DeclaringType = CreateDeclRef(declDef, module, injector);
            }

            if (InjecteeType.ContainsGenericParameters)
                CecilHelpers.ImportGenericParameters(reference, InjecteeType);

            return reference;
        }
开发者ID:MarkusSintonen,项目名称:MNetInjector,代码行数:22,代码来源:TypeInjectees.cs


示例17: Resolve

        public ITypeContainer Resolve(IMetadataScope scope)
        {
            AssemblyNameReference assemblyName = scope as AssemblyNameReference;

            if (assemblyName != null)
            {
                var assembly = Assembly.Load(new AssemblyName(assemblyName.FullName));
                return new AssemblyTypeContainer(assembly);
            }

            ModuleDefinition moduleDefinition = scope as ModuleDefinition;

            if (moduleDefinition != null)
            {
                if (moduleDefinition.Assembly != null)
                {
                    var assembly = Assembly.Load(new AssemblyName(moduleDefinition.Assembly.FullName));
                    return new AssemblyTypeContainer(assembly);
                }
            }

            throw new NotImplementedException();
        }
开发者ID:gmf520,项目名称:Smocks,代码行数:23,代码来源:ModuleResolver.cs


示例18: MemberNode

 public MemberNode(string member, IMetadataScope scope, MessageTypes type)
 {
     this.member = member;
     this.scope = scope;
     this.type = type;
     Text = member;
     // Cells.Add(new Cell((scope != null) ? scope.ToString() : ""));
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:8,代码来源:MainForm.cs


示例19: TypeReference

		public TypeReference (string name, string ns, IMetadataScope scope, bool valueType) :
			this (name, ns, scope)
		{
			m_isValueType = valueType;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:TypeReference.cs


示例20: AttachToScope

		internal void AttachToScope (IMetadataScope scope)
		{
			m_scope = scope;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:TypeReference.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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