コード例 #1
0
        void GetVirtualMethods(AssemblyCache cache, C5.TreeSet <MethodKey> methods, TypeDefinition type)
        {
            // check the interfaces
            foreach (TypeReference ifaceRef in type.Interfaces)
            {
                TypeDefinition iface = project.GetTypeDefinition(ifaceRef);

                // if it's not in the project, try to get it via the cache
                if (iface == null)
                {
                    iface = cache.GetTypeDefinition(ifaceRef);
                }

                // search interface
                if (iface != null)
                {
                    GetVirtualMethods(cache, methods, iface);
                }
            }

            // check the base type unless it isn't in the project, or we don't have one
            TypeDefinition baseType = project.GetTypeDefinition(type.BaseType);

            // if it's not in the project, try to get it via the cache
            if (baseType == null)
            {
                baseType = cache.GetTypeDefinition(type.BaseType);
            }

            // search base
            if (baseType != null)
            {
                GetVirtualMethods(cache, methods, baseType);
            }

            foreach (MethodDefinition method in type.Methods)
            {
                if (method.IsVirtual)
                {
                    methods.Add(new MethodKey(method));
                }
            }
        }
コード例 #2
0
ファイル: InheritMap.cs プロジェクト: chinshou/Obfuscar
 MethodKey[] GetVirtualMethods( AssemblyCache cache, TypeDefinition type )
 {
     C5.TreeSet<MethodKey> methods = new C5.TreeSet<MethodKey>( );
     GetVirtualMethods( cache, methods, type );
     return methods.ToArray( );
 }
コード例 #3
0
 MethodKey[] GetVirtualMethods(AssemblyCache cache, TypeDefinition type)
 {
     C5.TreeSet <MethodKey> methods = new C5.TreeSet <MethodKey>( );
     GetVirtualMethods(cache, methods, type);
     return(methods.ToArray( ));
 }
コード例 #4
0
 public void C5_TreeSet() => _ = new C5.TreeSet <Int32>();