コード例 #1
0
ファイル: TreeViewHandler.cs プロジェクト: Dekken/buildatron
 public static TreeViewHandler getInstance()
 {
     if (TreeViewHandler.instance == null){
         TreeViewHandler.instance = new TreeViewHandler();
     }
     return TreeViewHandler.instance;
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        public void AddTreeView(TreeView treeView)
        {
            var handler = new TreeViewHandler(treeView);

            _filter.MouseDown += handler.MouseDown;
            _filter.MouseMove += handler.MouseMove;
            _filter.MouseUp   += handler.MouseUp;
        }
コード例 #7
0
        public TargetSelectViewModel(TreeViewHandler handler)
        {
            InitializeCommands();

            TargetTree = handler;

            Result = false;
        }
コード例 #8
0
        public TargetSelectViewModel(TreeView view)
        {
            InitializeCommands();
            TargetTree = new TreeViewHandler(new RelayCommand <DependencyPropertyEventArgs>(TreeViewSelectedItemChangedCallback));
            TargetTree.View.Add(CopyTreeView(view));

            Result = false;
        }
コード例 #9
0
 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();
 }
コード例 #10
0
 private void txtPath_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         string path = txtPath.Text.Trim();
         TreeViewHandler.FindPath(path);
         e.Handled = true;
     }
 }
コード例 #11
0
 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();
 }
コード例 #12
0
        private static void HandleToolStripItemsState(TreeViewHandler treeViewHandler)
        {
            if (!(treeViewHandler.CurrentForm is MainForm))
            {
                return;
            }

            var mainForm = (MainForm)treeViewHandler.CurrentForm;

            mainForm.HandleToolStripItemsState();
        }
コード例 #13
0
 public TreeTypeDTO[] GetTreeTypes()
 {
     try
     {
         TreeViewHandler treeViewManager = new TreeViewHandler();
         return(treeViewManager.GetTreeTypes());
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
コード例 #14
0
 public void SetDefaultTreeType(int TreeTypeId)
 {
     try
     {
         TreeViewHandler treeViewManager = new TreeViewHandler();
         treeViewManager.SetDefaultTreeType(TreeTypeId);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
コード例 #15
0
 public BookingChartTreeDTO[] GetTreeData(out string DefaultTreeTypeCode)
 {
     try
     {
         TreeViewHandler treeViewManager = new TreeViewHandler();
         return(treeViewManager.GetTreeData(out DefaultTreeTypeCode));
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
コード例 #16
0
 public string GetDefaultTreeType()
 {
     try
     {
         TreeViewHandler treeViewManager = new TreeViewHandler();
         return(treeViewManager.GetDefaultTreeType());
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
コード例 #17
0
        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);
            }
        }
コード例 #18
0
        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;
        }
コード例 #19
0
 /// <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));
 }
コード例 #20
0
 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);
         }
     }
 }
コード例 #21
0
        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;
            }
        }
コード例 #22
0
        //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);
            //}
        }
コード例 #23
0
        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);
            }
        }
コード例 #24
0
        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);
            }
        }
コード例 #25
0
        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);
        }
コード例 #26
0
        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;
        }
コード例 #27
0
        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);
        }
コード例 #28
0
 private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     TreeViewHandler.treeView1_AfterLabelEdit(sender, e);
 }
コード例 #29
0
 private void treeView1_DoubleClick(object sender, EventArgs e)
 {
     TreeViewHandler.treeView1_DoubleClick(sender, e);
 }
コード例 #30
0
 private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     TreeViewHandler.treeView1_NodeMouseClick(sender, e);
 }
コード例 #31
0
 private void treeView1_KeyUp(object sender, KeyEventArgs e)
 {
     TreeViewHandler.treeView1_KeyUp(sender, e);
 }