/// <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;
		}
コード例 #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);
        }
コード例 #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;
		}
コード例 #6
0
		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;
		}
コード例 #7
0
		RootDocumentNodeCreator(IDocumentTreeView documentTreeView, DsDocumentNode fileNode, bool restoreIndex) {
			this.documentTreeView = documentTreeView;
			documentNode = fileNode;
			this.restoreIndex = restoreIndex;
		}
コード例 #8
0
		public RootDocumentNodeCreator(IDocumentTreeView documentTreeView, DsDocumentNode asmNode)
			: this(documentTreeView, asmNode, true) {
		}
コード例 #9
0
ファイル: SearchControlVM.cs プロジェクト: manojdjoshi/dnSpy
		bool CanSearchFile(DsDocumentNode node) =>
			SearchSettings.SearchGacAssemblies || !GacInfo.IsGacPath(node.Document.Filename);
コード例 #10
0
ファイル: NewDsDocument.cs プロジェクト: manojdjoshi/dnSpy
		public DsDocumentNode Create(IDocumentTreeView documentTreeView, DsDocumentNode owner, IDsDocument document) {
			var myDocument = document as MyDsDocument;
			if (myDocument != null)
				return new MyDsDocumentNode(myDocument);
			return null;
		}
コード例 #11
0
ファイル: AssemblyCommands.cs プロジェクト: manojdjoshi/dnSpy
		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]);
		}
コード例 #12
0
ファイル: AssemblyCommands.cs プロジェクト: manojdjoshi/dnSpy
			public UndoRedoInfo(DsDocumentNode node, bool isInUndo, bool isInRedo) {
				IsInUndo = isInUndo;
				IsInRedo = isInRedo;
				Node = node;
			}
コード例 #13
0
ファイル: ModuleCommands.cs プロジェクト: manojdjoshi/dnSpy
		AddExistingNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode)
			: base(undoCommandService, asmNode, modNode, false) {
		}
コード例 #14
0
ファイル: ModuleCommands.cs プロジェクト: manojdjoshi/dnSpy
		AddNewNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode)
			: base(undoCommandService, asmNode, modNode, true) {
		}
コード例 #15
0
ファイル: ModuleCommands.cs プロジェクト: manojdjoshi/dnSpy
		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;
		}