예제 #1
0
        static IEnumerable <UndoRedoInfo> GetUndoRedoInfo(IUndoCommandManager undoCommandManager, IEnumerable <IDnSpyFileNode> nodes)
        {
            var modifiedUndoAsms = new HashSet <IUndoObject>(undoCommandManager.UndoObjects);
            var modifiedRedoAsms = new HashSet <IUndoObject>(undoCommandManager.RedoObjects);

            foreach (var node in nodes)
            {
                var  uo       = undoCommandManager.GetUndoObject(node.DnSpyFile);
                bool isInUndo = modifiedUndoAsms.Contains(uo);
                bool isInRedo = modifiedRedoAsms.Contains(uo);
                yield return(new UndoRedoInfo(node, isInUndo, isInRedo));
            }
        }
예제 #2
0
 public void Execute()
 {
     Debug.Assert(modNode.TreeNode.Parent == null);
     if (modNode.TreeNode.Parent != null)
     {
         throw new InvalidOperationException();
     }
     asmNode.TreeNode.EnsureChildrenLoaded();
     asmNode.DnSpyFile.AssemblyDef.Modules.Add(modNode.DnSpyFile.ModuleDef);
     asmNode.DnSpyFile.Children.Add(modNode.DnSpyFile);
     asmNode.TreeNode.AddChild(modNode.TreeNode);
     if (modNodeWasCreated)
     {
         undoCommandManager.MarkAsModified(undoCommandManager.GetUndoObject(modNode.DnSpyFile));
     }
 }
예제 #3
0
 public void Execute()
 {
     fileNodeCreator.Add();
     undoCommandManager.MarkAsModified(undoCommandManager.GetUndoObject(fileNodeCreator.DnSpyFileNode.DnSpyFile));
 }
예제 #4
0
		static IEnumerable<UndoRedoInfo> GetUndoRedoInfo(IUndoCommandManager undoCommandManager, IEnumerable<IDnSpyFileNode> nodes) {
			var modifiedUndoAsms = new HashSet<IUndoObject>(undoCommandManager.UndoObjects);
			var modifiedRedoAsms = new HashSet<IUndoObject>(undoCommandManager.RedoObjects);
			foreach (var node in nodes) {
				var uo = undoCommandManager.GetUndoObject(node.DnSpyFile);
				bool isInUndo = modifiedUndoAsms.Contains(uo);
				bool isInRedo = modifiedRedoAsms.Contains(uo);
				yield return new UndoRedoInfo(node, isInUndo, isInRedo);
			}
		}