コード例 #1
0
ファイル: Form_main.cs プロジェクト: gene71/PD
        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;
            }
        }
コード例 #2
0
ファイル: Form_main.cs プロジェクト: gene71/PD
 //scan file
 private void textToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     scanFile(UIVars.GetWorkingFilePath());
 }