Ejemplo n.º 1
0
        private void treeResult_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string sindex = UtilWxg.GetMatchGroup(e.Node.Name, @"^(\d+)", 1);

            if (!string.IsNullOrEmpty(sindex))
            {
                int index = int.Parse(sindex);
                txtFileContent.Select(index, e.Node.Text.Length);
                txtFileContent.ScrollToCaret();
            }
        }
Ejemplo n.º 2
0
        private void treeFiles_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            bool ctrClick = (ModifierKeys & Keys.Control) == Keys.Control;

            if (ctrClick && e.Node.Nodes.Count > 0)
            {
                txtFilePath.Text = e.Node.Name;
                return;
            }

            bool sftClick = (ModifierKeys & Keys.Shift) == Keys.Shift;

            if (sftClick)
            {
                txtFilePath.Text = UtilWxg.ReplaceMatch(txtFilePath.Text, @"\\[^\\]+\\?$", "");
                return;
            }

            if (File.Exists(e.Node.Name))
            {
                txtInput.Text        = File.ReadAllText(e.Node.Name, Config.Encoding);
                tabInput.SelectedTab = tabInput.TabPages["tabInputContent"];
            }
        }