Beispiel #1
0
		Task<List<ReferenceSegment>> IAssemblyBrowserNodeBuilder.DisassembleAsync (TextEditor data, ITreeNavigator navigator)
		{
			if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity (navigator, data)) 
				return EmptyReferenceSegmentTask;
			var evt = (IEvent)navigator.DataItem;
			return MethodDefinitionNodeBuilder.DisassembleAsync (data, rd => rd.DisassembleEvent (evt.ParentModule.PEFile, (System.Reflection.Metadata.EventDefinitionHandle)evt.MetadataToken));
		}
Beispiel #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);
		}
Beispiel #3
0
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var property = (PropertyDefinition)navigator.DataItem;

            return(MethodDefinitionNodeBuilder.Disassemble(data, rd => rd.DisassembleProperty(property)));
        }
Beispiel #4
0
        Task <List <ReferenceSegment> > IAssemblyBrowserNodeBuilder.DisassembleAsync(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(EmptyReferenceSegmentTask);
            }
            var property = (IProperty)navigator.DataItem;

            return(MethodDefinitionNodeBuilder.DisassembleAsync(data, rd => rd.DisassembleProperty(property.ParentModule.PEFile, (System.Reflection.Metadata.PropertyDefinitionHandle)property.MetadataToken)));
        }
Beispiel #5
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));
 }
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile(TextEditor data, ITreeNavigator navigator, DecompileFlags flags)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var field = (FieldDefinition)navigator.DataItem;

            if (field == null)
            {
                return(null);
            }
            return(MethodDefinitionNodeBuilder.Decompile(data, MethodDefinitionNodeBuilder.GetAssemblyLoader(navigator), b => b.Decompile(field), flags: flags));
        }
        List <ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var field = (FieldDefinition)navigator.DataItem;

            if (field == null)
            {
                return(null);
            }
            return(MethodDefinitionNodeBuilder.Disassemble(data, rd => rd.DisassembleField(field)));
        }
        Task <List <ReferenceSegment> > IAssemblyBrowserNodeBuilder.DisassembleAsync(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(EmptyReferenceSegmentTask);
            }
            var field = (IField)navigator.DataItem;

            if (field == null)
            {
                return(EmptyReferenceSegmentTask);
            }
            return(MethodDefinitionNodeBuilder.DisassembleAsync(data, rd => rd.DisassembleField(field.ParentModule.PEFile, (System.Reflection.Metadata.FieldDefinitionHandle)field.MetadataToken)));
        }
        public Task <List <ReferenceSegment> > DisassembleAsync(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(EmptyReferenceSegmentTask);
            }
            var type = (ITypeDefinition)navigator.DataItem;

            if (type == null)
            {
                return(EmptyReferenceSegmentTask);
            }

            return(MethodDefinitionNodeBuilder.DisassembleAsync(data, rd => rd.DisassembleType(type.ParentModule.PEFile, (System.Reflection.Metadata.TypeDefinitionHandle)type.MetadataToken)));
        }
Beispiel #10
0
        public List <ReferenceSegment> Disassemble(TextEditor data, ITreeNavigator navigator)
        {
            if (MethodDefinitionNodeBuilder.HandleSourceCodeEntity(navigator, data))
            {
                return(null);
            }
            var type = (TypeDefinition)navigator.DataItem;

            if (type == null)
            {
                return(null);
            }

            return(MethodDefinitionNodeBuilder.Disassemble(data, rd => rd.DisassembleType(type)));
        }
        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));
        }