Ejemplo n.º 1
0
        private void DecompileSelectedNodes(DecompilerTextViewState state = null, bool recordHistory = true)
        {
            if (ignoreDecompilationRequests)
            {
                return;
            }

            if (recordHistory)
            {
                var dtState = decompilerTextView.GetState();
                if (dtState != null)
                {
                    history.UpdateCurrent(new NavigationState(dtState));
                }
                history.Record(new NavigationState(treeView.SelectedItems.OfType <SharpTreeNode>()));
            }

            if (treeView.SelectedItems.Count == 1)
            {
                ILSpyTreeNode node = treeView.SelectedItem as ILSpyTreeNode;
                if (node != null && node.View(decompilerTextView))
                {
                    return;
                }
            }
            decompilerTextView.Decompile(this.CurrentLanguage, this.SelectedNodes, new DecompilationOptions()
            {
                TextViewState = state
            });
        }
Ejemplo n.º 2
0
        private void DecompileSelectedNodes(DecompilerTextViewState state = null)
        {
            if (ignoreDecompilationRequests)
            {
                return;
            }

            if (treeView.SelectedItems.Count == 1)
            {
                ILSpyTreeNode node = treeView.SelectedItem as ILSpyTreeNode;
                if (node != null && node.View(decompilerTextView))
                {
                    return;
                }
            }
            decompilerTextView.Decompile(this.CurrentLanguage, this.SelectedNodes, new DecompilationOptions()
            {
                TextViewState = state
            });
        }
Ejemplo n.º 3
0
		void DecompileSelectedNodes(DecompilerTextViewState state = null, bool recordHistory = true)
		{
			if (ignoreDecompilationRequests)
				return;
			
			if (recordHistory) {
				var dtState = decompilerTextView.GetState();
				if(dtState != null)
					history.UpdateCurrent(new NavigationState(dtState));
				history.Record(new NavigationState(treeView.SelectedItems.OfType<SharpTreeNode>()));
			}
			
			if (treeView.SelectedItems.Count == 1) {
				ILSpyTreeNode node = treeView.SelectedItem as ILSpyTreeNode;
				if (node != null && node.View(decompilerTextView))
					return;
			}
			decompilationTask = decompilerTextView.DecompileAsync(this.CurrentLanguage, this.SelectedNodes, new DecompilationOptions() { TextViewState = state });
		}
Ejemplo n.º 4
0
        bool? DecompileNodes(DecompileTabState tabState, DecompilerTextViewState state, bool recordHistory, Language language, ILSpyTreeNode[] nodes, bool forceDecompile = false)
        {
            if (tabState.ignoreDecompilationRequests)
                return null;

            // Ignore all nodes that have been deleted
            nodes = FilterOutDeletedNodes(nodes);

            if (tabState.HasDecompiled && !forceDecompile && tabState.Equals(nodes, language)) {
                if (state != null)
                    tabState.TextView.EditorPositionState = state.EditorPositionState;
                return false;
            }

            if (tabState.HasDecompiled && recordHistory)
                RecordHistory(tabState);

            tabState.HasDecompiled = true;
            tabState.SetDecompileProps(language, nodes);

            if (nodes.Length == 1) {
                var node = nodes[0];

                var viewObject = node.GetViewObject(tabState.TextView);
                if (viewObject != null) {
                    tabState.TextView.CancelDecompileAsync();
                    tabState.Content = viewObject;
                    return true;
                }

                if (node.View(tabState.TextView)) {
                    tabState.Content = tabState.TextView;
                    tabState.TextView.CancelDecompileAsync();
                    return true;
                }
            }

            tabState.Content = tabState.TextView;
            tabState.TextView.DecompileAsync(language, nodes, new DecompilationOptions() { TextViewState = state, DecompilerTextView = tabState.TextView });
            return true;
        }
Ejemplo n.º 5
0
 public NavigationState(IEnumerable <SharpTreeNode> treeNodes, DecompilerTextViewState viewState)
 {
     this.treeNodes = new HashSet <SharpTreeNode>(treeNodes);
     ViewState      = viewState;
 }
Ejemplo n.º 6
0
		private void DecompileSelectedNodes(DecompilerTextViewState state = null)
		{
			if (ignoreDecompilationRequests)
				return;

			if (treeView.SelectedItems.Count == 1) {
				ILSpyTreeNode node = treeView.SelectedItem as ILSpyTreeNode;
				if (node != null && node.View(decompilerTextView))
					return;
			}
			decompilerTextView.Decompile(this.CurrentLanguage, this.SelectedNodes, new DecompilationOptions() { TextViewState = state });
		}
Ejemplo n.º 7
0
 public NavigationState(DecompilerTextViewState viewState)
 {
     this.treeNodes = new HashSet <SharpTreeNode>(viewState.DecompiledNodes);
     ViewState      = viewState;
 }