public void RemoveModule(dnModule module) { if (treeView.InvokeRequired) { treeView.Invoke(new Action <dnModule>(RemoveModule), module); } if (module.ModuleDef != null) { if (!resolver.RemoveModuleDef(module.ModuleDef)) { return; } } foreach (DataTreeNodeX node in treeView.Nodes) { if (node != null && node.Model is dnModuleModel) { var nodeModule = ((dnModuleModel)node.Model).Module; if (nodeModule == module) { treeView.Nodes.Remove(node); OnNodeSelected(treeView, new TreeViewEventArgs(treeView.SelectedNode)); } } } }
public Task LoadModule(string path) { if (treeView.InvokeRequired) { return((Task)treeView.Invoke(new Func <string, Task>(LoadModule), path)); } return(Task.Factory.StartNew(() => { var module = new dnModule(path, new ModuleContext(resolver)); if (module.ModuleDef != null) { ModuleDefMD cached; if (!resolver.AddModuleDef(module.ModuleDef, out cached)) { return null; } } return module; }).ContinueWith(task => { if (task.Result != null) { treeView.Nodes.Add(new dnModuleModel(task.Result).ToNode()); } }, TaskScheduler.FromCurrentSynchronizationContext())); }
public Task LoadModule(string path) { if (treeView.InvokeRequired) { return (Task)treeView.Invoke(new Func<string, Task>(LoadModule), path); } return Task.Factory.StartNew(() => { var module = new dnModule(path, new ModuleContext(resolver)); if (module.ModuleDef != null) { ModuleDefMD cached; if (!resolver.AddModuleDef(module.ModuleDef, out cached)) return null; } return module; }).ContinueWith(task => { if (task.Result != null) treeView.Nodes.Add(new dnModuleModel(task.Result).ToNode()); }, TaskScheduler.FromCurrentSynchronizationContext()); }
public void RemoveModule(dnModule module) { if (treeView.InvokeRequired) { treeView.Invoke(new Action<dnModule>(RemoveModule), module); } if (module.ModuleDef != null) { if (!resolver.RemoveModuleDef(module.ModuleDef)) return; } foreach (DataTreeNodeX node in treeView.Nodes) { if (node != null && node.Model is dnModuleModel) { var nodeModule = ((dnModuleModel)node.Model).Module; if (nodeModule == module) { treeView.Nodes.Remove(node); OnNodeSelected(treeView, new TreeViewEventArgs(treeView.SelectedNode)); } } } }
public ExportForm(dnModule module) { Module = module; Text = "Export " + module.Name; Initialize(); }