/// <summary>
		/// Creates a <see cref="NotifyDocumentTreeViewCollection.Add"/> instance
		/// </summary>
		/// <param name="document">Added document</param>
		/// <returns></returns>
		public static NotifyDocumentTreeViewCollectionChangedEventArgs CreateAdd(DsDocumentNode document) {
			Debug.Assert(document != null);
			var e = new NotifyDocumentTreeViewCollectionChangedEventArgs();
			e.Type = NotifyDocumentTreeViewCollection.Add;
			e.Nodes = new DsDocumentNode[] { document };
			return e;
		}
		/// <summary>
		/// Creates a <see cref="NotifyDocumentTreeViewCollection.Remove"/> instance
		/// </summary>
		/// <param name="documents">Removed documents</param>
		/// <returns></returns>
		public static NotifyDocumentTreeViewCollectionChangedEventArgs CreateRemove(DsDocumentNode[] documents) {
			Debug.Assert(documents != null);
			var e = new NotifyDocumentTreeViewCollectionChangedEventArgs();
			e.Type = NotifyDocumentTreeViewCollection.Remove;
			e.Nodes = documents;
			return e;
		}
		/// <summary>
		/// Creates a <see cref="NotifyDocumentTreeViewCollection.Clear"/> instance
		/// </summary>
		/// <param name="clearedDocuments">All cleared documents</param>
		/// <returns></returns>
		public static NotifyDocumentTreeViewCollectionChangedEventArgs CreateClear(DsDocumentNode[] clearedDocuments) {
			Debug.Assert(clearedDocuments != null);
			var e = new NotifyDocumentTreeViewCollectionChangedEventArgs();
			e.Type = NotifyDocumentTreeViewCollection.Clear;
			e.Nodes = clearedDocuments;
			return e;
		}
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a <see cref="NotifyDocumentTreeViewCollection.Add"/> instance
        /// </summary>
        /// <param name="document">Added document</param>
        /// <returns></returns>
        public static NotifyDocumentTreeViewCollectionChangedEventArgs CreateAdd(DsDocumentNode document)
        {
            Debug.Assert(document != null);
            var e = new NotifyDocumentTreeViewCollectionChangedEventArgs();

            e.Type  = NotifyDocumentTreeViewCollection.Add;
            e.Nodes = new DsDocumentNode[] { document };
            return(e);
        }
Ejemplo n.º 5
0
		public static bool HasPENode(DsDocumentNode node) {
			if (node == null)
				return false;

			var peImage = node.Document.PEImage;

			// Only show the PE node if it was loaded from a file. The hex document is always loaded
			// from a file, so if the PEImage wasn't loaded from the same file, conversion to/from
			// RVA/FileOffset won't work and the wrong data will be displayed, eg. in the .NET
			// storage stream nodes.
			bool loadedFromFile = node.Document.Key is FilenameKey;
			return loadedFromFile && peImage != null;
		}
		public DsDocumentNode Create(IDocumentTreeView documentTreeView, DsDocumentNode owner, IDsDocument document) {
			var dnDocument = document as IDsDotNetDocument;
			if (dnDocument != null) {
				Debug.Assert(document.ModuleDef != null);
				if (document.AssemblyDef == null || owner != null)
					return new ModuleDocumentNodeImpl(dnDocument);
				return new AssemblyDocumentNodeImpl(dnDocument);
			}
			Debug.Assert(document.AssemblyDef == null && document.ModuleDef == null);
			if (document.PEImage != null)
				return new PEDocumentNodeImpl(document);

			return null;
		}
Ejemplo n.º 7
0
		RootDocumentNodeCreator(IDocumentTreeView documentTreeView, DsDocumentNode fileNode, bool restoreIndex) {
			this.documentTreeView = documentTreeView;
			documentNode = fileNode;
			this.restoreIndex = restoreIndex;
		}
Ejemplo n.º 8
0
		public RootDocumentNodeCreator(IDocumentTreeView documentTreeView, DsDocumentNode asmNode)
			: this(documentTreeView, asmNode, true) {
		}
Ejemplo n.º 9
0
		bool CanSearchFile(DsDocumentNode node) =>
			SearchSettings.SearchGacAssemblies || !GacInfo.IsGacPath(node.Document.Filename);
Ejemplo n.º 10
0
		public DsDocumentNode Create(IDocumentTreeView documentTreeView, DsDocumentNode owner, IDsDocument document) {
			var myDocument = document as MyDsDocument;
			if (myDocument != null)
				return new MyDsDocumentNode(myDocument);
			return null;
		}
Ejemplo n.º 11
0
		RemoveAssemblyCommand(IDocumentTreeView documentTreeView, DsDocumentNode[] asmNodes) {
			savedStates = new RootDocumentNodeCreator[asmNodes.Length];
			for (int i = 0; i < savedStates.Length; i++)
				savedStates[i] = new RootDocumentNodeCreator(documentTreeView, asmNodes[i]);
		}
Ejemplo n.º 12
0
			public UndoRedoInfo(DsDocumentNode node, bool isInUndo, bool isInRedo) {
				IsInUndo = isInUndo;
				IsInRedo = isInRedo;
				Node = node;
			}
Ejemplo n.º 13
0
		AddExistingNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode)
			: base(undoCommandService, asmNode, modNode, false) {
		}
Ejemplo n.º 14
0
		AddNewNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode)
			: base(undoCommandService, asmNode, modNode, true) {
		}
Ejemplo n.º 15
0
		protected AddNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode, bool modNodeWasCreated) {
			this.undoCommandService = undoCommandService;
			if (!(asmNode is AssemblyDocumentNode))
				asmNode = (AssemblyDocumentNode)asmNode.TreeNode.Parent.Data;
			this.asmNode = (AssemblyDocumentNode)asmNode;
			this.modNode = modNode;
			this.modNodeWasCreated = modNodeWasCreated;
		}