Ejemplo n.º 1
0
        private void treeView_ScanDir_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //open node contents and display to main text box
            try
            {
                //call helper to set working file path
                var f = getFullPathFromTreeViewNode(e.Node.FullPath);
                if (f != null)
                {
                    UIVars.SetWorkingFilePath(f + e.Node.FullPath);

                    //set the text box contents
                    richTextBox_main.Text = File.ReadAllText(UIVars.GetWorkingFilePath());
                    richTextBox_output.AppendText("Displaying contents for: " + UIVars.WorkingFileName + "\n");
                }
                else
                {
                    //was null show message
                    richTextBox_output.AppendText(e.Node + ": is not a file.\n");
                }
            }
            catch (Exception ex)
            {
                //TODO: Add Logging
                richTextBox_error.Text = "Error opening: " + e.Node.FullPath + " " + ex.Message;
            }
        }
Ejemplo n.º 2
0
 //scan file
 private void textToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     scanFile(UIVars.GetWorkingFilePath());
 }