Esempio n. 1
0
        public List <ReferenceSegment> Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            var assemblyLoader = (AssemblyLoader)navigator.DataItem;

            return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b =>
                                                         b.DecompileModuleAndAssemblyAttributes(), flags: flags));
        }
Esempio n. 2
0
 List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
 {
     if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
     {
         return(null);
     }
     if (!(navigator.DataItem is IProperty property))
     {
         return(null);
     }
     return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b => b.Decompile(property.MetadataToken), flags: flags));
 }
        public List <ReferenceSegment> Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var cecilMethod = (MethodDefinition)navigator.DataItem;

            if (cecilMethod == null)
            {
                return(null);
            }
            return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b => b.Decompile(cecilMethod), flags: flags));
        }
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var evt = navigator.DataItem as EventDefinition;

            if (evt == null)
            {
                return(null);
            }
            return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b => b.Decompile(evt), flags: flags));
        }
        public List <ReferenceSegment> Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var type = (ITypeDefinition)navigator.DataItem;

            if (type == null)
            {
                return(null);
            }
            var settings = MethodDefinitionNodeBuilder.GetDecompilerSettings(data, flags.PublicOnly);

            // CSharpLanguage.Instance.DecompileType (type, output, settings);
            return(MethodDefinitionNodeBuilder.Decompile(
                       data,
                       MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator),
                       builder => builder.Decompile(type.MetadataToken), flags: flags));
        }