private void cmdExperiment_Click(object sender, EventArgs e) { frmCodeView frmFoo = new frmCodeView(); frmCodeViewNew docForm = new frmCodeViewNew("C:\\Data\\NCC\\!Code\\Git.Public\\ncccodenavi\\Win.CodeNavi\\Win.CodeNavi\\Scanner.cs", 0, this); docForm.MdiParent = this; docForm.Show(); }
/// <summary> /// /// </summary> private void OpenFiles() { for (int intCount = 0; intCount < lstResults.SelectedItems.Count; intCount++) { // Now initalize a search form frmCodeViewNew frmSearch = new frmCodeViewNew(lstResults.SelectedItems[intCount].SubItems[0].Text + "\\" + lstResults.SelectedItems[intCount].SubItems[1].Text, Convert.ToInt32(lstResults.SelectedItems[intCount].SubItems[3].Text), frmMaster); frmSearch.MdiParent = this.MdiParent; frmSearch.Visible = true; } }
private void cmdOpeninCodeView_Click(object sender, EventArgs e) { StringBuilder sbTemp = new StringBuilder(); if (treeFiles.SelectedNode == null) { return; } sbTemp.Append(treeFiles.SelectedNode.Text); TreeNode treeNodeTmp = treeFiles.SelectedNode; while (true) { if (treeNodeTmp.Parent == null) { break; } treeNodeTmp = treeNodeTmp.Parent; sbTemp.Insert(0, treeNodeTmp.Text + "\\"); } if (File.Exists(sbTemp.ToString()) == true) { byte[] fileBytes = null; try { fileBytes = File.ReadAllBytes(sbTemp.ToString()); } catch (Exception) { } Encoding encodingForFile = null; if (IsTextTester.IsText(out encodingForFile, sbTemp.ToString(), 1000) == true && fileBytes != null) { // Now initalize a search form frmCodeViewNew frmSearch = new frmCodeViewNew(sbTemp.ToString(), 0, frmMaster); frmSearch.MdiParent = this.MdiParent; frmSearch.Visible = true; } else if (IsTextTester.IsText(out encodingForFile, sbTemp.ToString(), 100) == false && fileBytes != null) { this.scintilla.Text = sbTemp.ToString() + " is binary and can't be displayed"; } else if (fileBytes == null) { this.scintilla.Text = sbTemp.ToString() + " could not be opened"; } } }
/// <summary> /// Opens a file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openFileToolStripMenuItem_Click(object sender, EventArgs e) { string strFile = null; int intLine = 0; if (richNotes.SelectedText.Count() > 0) { if (richNotes.SelectedText.Trim().Substring(3, richNotes.SelectedText.Trim().Count() - 3).Contains(':') == true) { string[] strBits = richNotes.SelectedText.Trim().Split(':'); if (strBits.Count() == 3 && strBits[2].Count() > 0) { if (File.Exists(strBits[0] + ":" + strBits[1])) { strFile = strBits[0] + ":" + strBits[1]; intLine = Convert.ToInt32(strBits[2]); } else { UpdateNotesStatus("File not found " + richNotes); } } } else if (File.Exists(richNotes.SelectedText) == true) { strFile = richNotes.SelectedText; } else { UpdateNotesStatus("File not found " + richNotes); } } frmCodeViewNew frmSearch = new frmCodeViewNew(strFile, intLine, this); frmSearch.MdiParent = this; frmSearch.Visible = true; }
/// <summary> /// /// </summary> private void OpenFiles() { for (int intCount = 0; intCount < lstResults.SelectedItems.Count; intCount++) { // Now initalize a search form frmCodeViewNew frmSearch = new frmCodeViewNew(lstResults.SelectedItems[intCount].SubItems[0].Text + "\\" + lstResults.SelectedItems[intCount].SubItems[1].Text, Convert.ToInt32(lstResults.SelectedItems[intCount].SubItems[3].Text),frmMaster); frmSearch.MdiParent = this.MdiParent; frmSearch.Visible = true; } }
private void cmdOpeninCodeView_Click(object sender, EventArgs e) { StringBuilder sbTemp = new StringBuilder(); if (treeFiles.SelectedNode == null) return; sbTemp.Append(treeFiles.SelectedNode.Text); TreeNode treeNodeTmp = treeFiles.SelectedNode; while (true) { if (treeNodeTmp.Parent == null) break; treeNodeTmp = treeNodeTmp.Parent; sbTemp.Insert(0, treeNodeTmp.Text + "\\"); } if (File.Exists(sbTemp.ToString()) == true) { byte[] fileBytes = null; try { fileBytes = File.ReadAllBytes(sbTemp.ToString()); } catch (Exception) { } Encoding encodingForFile = null; if (IsTextTester.IsText(out encodingForFile, sbTemp.ToString(), 1000) == true && fileBytes != null) { // Now initalize a search form frmCodeViewNew frmSearch = new frmCodeViewNew(sbTemp.ToString(), 0 , frmMaster); frmSearch.MdiParent = this.MdiParent; frmSearch.Visible = true; } else if (IsTextTester.IsText(out encodingForFile, sbTemp.ToString(), 100) == false && fileBytes != null) { this.scintilla.Text = sbTemp.ToString() + " is binary and can't be displayed"; } else if (fileBytes == null) { this.scintilla.Text = sbTemp.ToString() + " could not be opened"; } } }