public static TreeViewHandler getInstance() { if (TreeViewHandler.instance == null){ TreeViewHandler.instance = new TreeViewHandler(); } return TreeViewHandler.instance; }
private void cmDeobf_Click(object sender, EventArgs e) { if (dgvData.SelectedRows.Count < 1) { SimpleMessage.ShowInfo("Please select assembly."); return; } try { if (_frmDeobf == null) { _frmDeobf = new frmDeobf(this, PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath), treeView1.SelectedNode.FullPath); } else { _frmDeobf.InitForm(this, PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath), treeView1.SelectedNode.FullPath); } _frmDeobf.ShowDialog(); TreeViewHandler.RefreshNode(treeView1.SelectedNode); } catch (Exception ex) { SimpleMessage.ShowException(ex); } }
private void cmDeleteFile_Click(object sender, EventArgs e) { if (dgvData.SelectedRows.Count < 1) { SimpleMessage.ShowInfo("Please select file."); return; } try { if (SimpleMessage.Confirm("Are you sure to delete selected file(s)?") == DialogResult.Yes) { string path = SimplePath.GetFullPath(treeView1.SelectedNode.FullPath); for (int i = 0; i < dgvData.SelectedRows.Count; i++) { string file = PathUtils.GetFileName(dgvData.SelectedRows[i], path); File.Delete(file); } TreeViewHandler.RefreshNode(treeView1.SelectedNode); } } catch (Exception ex) { SimpleMessage.ShowException(ex); } }
private void GetSelectedMethod() { _selectedMethod = TreeViewHandler.SelectedMethod; _selectedPath = null; if (_selectedMethod != null) { string path = null; TreeNode node = TreeViewHandler.SelectedNode; path = TreeViewHandler.GetTreeNodeText(node); int i = path.IndexOf("("); if (i > 0) { path = path.Substring(0, i); } while (node.Level > 2) { node = node.Parent; path = String.Format("{0}.{1}", TreeViewHandler.GetTreeNodeText(node), path); } if (path.StartsWith(".")) { path = path.Substring(1); } _selectedPath = path; } }
public MainForm() { InitializeComponent(); _treeViewHandler = new TreeViewHandler(treeView1, treeMenu); TabControl = tabControl1; ListAnalysis = listAnalysis; ListAnalysis.Columns[0].Width = -1; LblAnalysis = lblAnalysis; DgBody = dgBody; DgVariables = dgVariables; RtbILSpy = rtbILSpy; TreeView = treeView1; ToolStrip = toolStrip1; InstructionMenuStrip = instructionMenu; VariableMenu = variableMenu; ExceptionHandlerMenu = exceptionHandlerMenu; TreeMenuStrip = treeMenu; txtMagicRegex.Text = Settings.Default.MagicRegex; InitializeBody(); cbSearchType.SelectedIndex = 0; }
public void AddTreeView(TreeView treeView) { var handler = new TreeViewHandler(treeView); _filter.MouseDown += handler.MouseDown; _filter.MouseMove += handler.MouseMove; _filter.MouseUp += handler.MouseUp; }
public TargetSelectViewModel(TreeViewHandler handler) { InitializeCommands(); TargetTree = handler; Result = false; }
public TargetSelectViewModel(TreeView view) { InitializeCommands(); TargetTree = new TreeViewHandler(new RelayCommand <DependencyPropertyEventArgs>(TreeViewSelectedItemChangedCallback)); TargetTree.View.Add(CopyTreeView(view)); Result = false; }
public ListViewHistoryHandler(ListView _tasksDetails, string _path, TreeViewHandler _treeViewHandler) : base(_tasksDetails, _path) { this.tasksDetails = _tasksDetails; this.path = _path; treeViewHandler = _treeViewHandler; treeViewHandler.AddPath(path); treeViewHandler.Refresh(); RefreshHistoryDetails(); }
private void txtPath_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string path = txtPath.Text.Trim(); TreeViewHandler.FindPath(path); e.Handled = true; } }
public ListViewPostinstallsHandler(ListView _machines, TreeViewHandler _treeViewHandler, ListBox _listBoxSelected, ListBox _listBoxPostInstalls, TextBlock _txtBlockPostInstalls) : base(_machines, _treeViewHandler) { if (Directory.Exists(@"I:\Images\Startup_OS\PostInstallers\")) { path = @"I:\Images\Startup_OS\PostInstallers\"; } listBoxSelected = _listBoxSelected; listBoxPostInstalls = _listBoxPostInstalls; txtBlockPostInstalls = _txtBlockPostInstalls; RefreshPostInstalls(); }
private static void HandleToolStripItemsState(TreeViewHandler treeViewHandler) { if (!(treeViewHandler.CurrentForm is MainForm)) { return; } var mainForm = (MainForm)treeViewHandler.CurrentForm; mainForm.HandleToolStripItemsState(); }
public TreeTypeDTO[] GetTreeTypes() { try { TreeViewHandler treeViewManager = new TreeViewHandler(); return(treeViewManager.GetTreeTypes()); } catch (Exception exp) { throw exp; } }
public void SetDefaultTreeType(int TreeTypeId) { try { TreeViewHandler treeViewManager = new TreeViewHandler(); treeViewManager.SetDefaultTreeType(TreeTypeId); } catch (Exception exp) { throw exp; } }
public BookingChartTreeDTO[] GetTreeData(out string DefaultTreeTypeCode) { try { TreeViewHandler treeViewManager = new TreeViewHandler(); return(treeViewManager.GetTreeData(out DefaultTreeTypeCode)); } catch (Exception exp) { throw exp; } }
public string GetDefaultTreeType() { try { TreeViewHandler treeViewManager = new TreeViewHandler(); return(treeViewManager.GetDefaultTreeType()); } catch (Exception exp) { throw exp; } }
private void cmFolderDasm_Click(object sender, EventArgs e) { try { frmDasm frm = new frmDasm(this, PathUtils.GetFullFileNames(dgvData.Rows, treeView1.SelectedNode.FullPath), treeView1.SelectedNode.FullPath); frm.ShowDialog(); TreeViewHandler.RefreshNode(treeView1.SelectedNode, true); } catch (Exception ex) { SimpleMessage.ShowException(ex); } }
public PickReferenceForm(string reference) { InitializeComponent(); _treeViewHandler = new TreeViewHandler(treeView1, treeMenu); treeView1.AllowDrop = true; _reference = reference; //TODO: Add detection to avoid useless assignment EditInstructionForm.SelectedReference = null; EditVariableForm.SelectedReference = null; EditExceptionHandlerForm.SelectedReference = null; }
/// <summary> /// Initialize Class Components /// </summary> private void Initialize() { WindowEnabled = true; BtnEnabled = true; TxtStatus = "Status: Waiting..."; TIALibrary = Visibility.Visible; FromPathLibrary = Visibility.Hidden; TxtChooseLibType = "Choose Path "; Libraries = new List <string>(); Worksheets = new List <string>(); GenerateHardwareCommand = new CommandBase(GenerateHardwareCommand_Executed); ChooseLibraryPathCommand = new CommandBase(ChooseLibraryPathCommand_Executed); ChooseLibTypeCommand = new CommandBase(ChooseLibTypeCommand_Executed); ProjectTree = new TreeViewHandler(new RelayCommand <DependencyPropertyEventArgs>(TreeViewItemSelectedChangedCallback)); }
private void frmMain_Shown(object sender, EventArgs e) { if (OpenAssemblyWithClassEditor(this.Arguments) > 0) { //argument loaded } else { //set last path, need to be after settings upgraded if (!String.IsNullOrEmpty(Config.LastPath) && Directory.Exists(Config.LastPath)) { TreeViewHandler.SetPath(Config.LastPath, true); } } }
private void frmMain_KeyUp(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.F5: TreeViewHandler.RefreshNode(treeView1.SelectedNode, true); e.Handled = true; break; case Keys.Escape: TreeViewHandler.EscPressed = true; e.Handled = true; break; } }
//TreeNode _lastSelectedNode = null; private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { //if (_lastSelectedNode != null) //{ // this.RemoveAssemblyResolveDir(_lastSelectedNode.FullPath); //} TreeViewHandler.RefreshNode(e.Node); //_lastSelectedNode = e.Node; //if (_lastSelectedNode != null) //{ // this.AddAssemblyResolveDir(_lastSelectedNode.FullPath); //} }
private void cmFolderAsm_Click(object sender, EventArgs e) { try { string path = treeView1.SelectedNode.FullPath; DirectoryInfo di = new DirectoryInfo(path); FileInfo[] files = di.GetFiles("*.il", SearchOption.AllDirectories); frmAsm frm = new frmAsm(this, PathUtils.GetFullFileNames(files, path), path); frm.ShowDialog(); TreeViewHandler.RefreshNode(treeView1.SelectedNode); } catch (Exception ex) { SimpleMessage.ShowException(ex); } }
private void cmStrongName_Click(object sender, EventArgs e) { if (dgvData.SelectedRows.Count < 1) { SimpleMessage.ShowInfo("Please select assembly."); return; } try { frmStrongName frm = new frmStrongName(this, PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath), treeView1.SelectedNode.FullPath); frm.ShowDialog(); TreeViewHandler.RefreshNode(treeView1.SelectedNode); } catch (Exception ex) { SimpleMessage.ShowException(ex); } }
public static bool OpenFile(TreeViewHandler treeViewHandler, string file, ref CurrentAssembly currentAssembly, bool clear = false) { if (string.IsNullOrEmpty(file)) { throw new ArgumentException("No path provided!"); } var newCurrentAssembly = new CurrentAssembly(file); if (newCurrentAssembly.ManifestModule == null) { HandleToolStripItemsState(treeViewHandler); return(false); } currentAssembly = newCurrentAssembly; treeViewHandler.LoadAssembly(currentAssembly.ManifestModule, file, clear); HandleToolStripItemsState(treeViewHandler); return(true); }
public TargetSelectViewModel(IEnumerable <dynamic> list) { InitializeCommands(); TargetTree = new TreeViewHandler(new RelayCommand <DependencyPropertyEventArgs>(TreeViewSelectedItemChangedCallback)); var treeView = new TreeView(); foreach (var item in list) { var sub = new TreeViewItem(); sub.Header = item.Name; sub.Tag = item; treeView.Items.Add(sub); } TargetTree.View.Add(treeView); Result = false; }
private int OpenAssemblyWithClassEditor(string[] files) { int count = 0; if (files == null || files.Length == 0) { return(count); } string path = files[0]; if (Directory.Exists(path)) { TreeViewHandler.SetPath(path, true); count++; } else { if (File.Exists(path)) { string filePath = Path.GetDirectoryName(path); TreeViewHandler.SetPath(filePath, true); TreeViewHandler.CheckDropFile(path); count++; } } for (int i = 1; i < files.Length; i++) { path = files[i]; if (File.Exists(path)) { TreeViewHandler.CheckDropFile(path); count++; } } return(count); }
private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { TreeViewHandler.treeView1_AfterLabelEdit(sender, e); }
private void treeView1_DoubleClick(object sender, EventArgs e) { TreeViewHandler.treeView1_DoubleClick(sender, e); }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { TreeViewHandler.treeView1_NodeMouseClick(sender, e); }
private void treeView1_KeyUp(object sender, KeyEventArgs e) { TreeViewHandler.treeView1_KeyUp(sender, e); }