Пример #1
0
        public Task <List <ReferenceSegment> > DecompileAsync(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            var assemblyLoader = (AssemblyLoader)navigator.DataItem;

            return(MethodDefinitionNodeBuilder.DecompileAsync(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b =>
                                                              b.DecompileModuleAndAssemblyAttributes(), flags: flags));
        }
Пример #2
0
		Task<List<ReferenceSegment>> IAssemblyBrowserNodeBuilder.DecompileAsync (TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
		{
			if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity (navigator, data)) 
				return EmptyReferenceSegmentTask;
			var evt = navigator.DataItem as IEvent;
			if (evt == null)
				return EmptyReferenceSegmentTask;
			return MethodDefinitionNodeBuilder.DecompileAsync (data, MethodDefinitionNodeBuilder.GetAssemblyLoader (navigator), b => b.Decompile (evt.MetadataToken), flags: flags);
		}
Пример #3
0
 Task <List <ReferenceSegment> > IAssemblyBrowserNodeBuilder.DecompileAsync(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
 {
     if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
     {
         return(EmptyReferenceSegmentTask);
     }
     if (!(navigator.DataItem is IProperty property))
     {
         return(EmptyReferenceSegmentTask);
     }
     return(MethodDefinitionNodeBuilder.DecompileAsync(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));
        }
Пример #5
0
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var property = navigator.DataItem as PropertyDefinition;

            if (property == null)
            {
                return(null);
            }
            return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b => b.Decompile(property), flags: flags));
        }
Пример #6
0
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var field = (IField)navigator.DataItem;

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

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

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