public FindReplaceForm(ExplorerForms ef) { InitializeComponent(); SuspendLayout(); BB = -1; toolStrip1.GripStyle = ToolStripGripStyle.Hidden; LoadLookIn(); LoadButtons(); checkBox1.Enabled = false; this.Controls.Remove(tabControl1); tabControl1.Visible = false; panel1.BackColor = Color.White; panel1.Dock = DockStyle.Fill; panel2.BackColor = Color.White; panel2.Dock = DockStyle.Fill; statusStrip1.BackColor = Color.White; LoadFindPanel(); this.ef = ef; contextMenuStrip1.ItemClicked += ContextMenuStrip1_ItemClicked; comboBox2.Text = "Entire Solution"; comboBox4.Text = "Entire Solution"; comboBox3.Text = "*.*"; comboBox7.Text = "*.*"; panel1.Resize += Panel1_Resize; panel2.Resize += Panel2_Resize; LoadSettings(); ResumeLayout(); }
public void HighLightWords() { ef = ExplorerForms.ef; if (Results == null) { return; } ArrayList R = ToArray(); //ef.scr.LoadSelectedWords(R); act = 0; }
private void dockRightToolStripMenuItem_Click(object sender, EventArgs e) { ExplorerForms ef = ExplorerForms.ef; if (ef == null) { return; } ToolStrip c = ToolCommands.TFF[0] as ToolStrip; ef.Command_ChangeToolstrip(c, AnchorStyles.Right); ClearPositionItems(); dockRightToolStripMenuItem.Checked = true; }
public void FindVSCmds() { DirectoryInfo d = new DirectoryInfo("C:\\Program Files (x86)"); DirectoryInfo[] dd = d.GetDirectories("Microsoft Visual Studio*"); string v2017 = ExplorerForms.GetVisualStudio2017InstalledPath(); if (!string.IsNullOrEmpty(v2017)) { if (Directory.Exists(v2017)) { Array.Resize(ref dd, dd.Length + 1); dd[dd.Length - 1] = new DirectoryInfo(v2017); } } foreach (DirectoryInfo c in dd) { DirectoryInfo[] cc = c.GetDirectories("Common7*"); foreach (DirectoryInfo ca in cc) { DirectoryInfo[] b = ca.GetDirectories("Tools"); if (b.Length > 0) { string[] pp = b[0].FullName.Split("\\".ToCharArray()); foreach (string s in pp) { if (s.StartsWith("Microsoft")) { string[] rr = s.Split(" ".ToCharArray()); AddToolButton(b[0].FullName, rr[rr.Length - 1]); } } //AddToolButton(b[0].FullName); } } } }
private void LoadAssemblies() { TreeView g = treeView1; g.AfterCheck += G_AfterCheck; g.CheckBoxes = true; img = new ImageList(); img.Images.Add("class", ve_resource.Class_yellow_16x); img.Images.Add("namespace", ve_resource.Namespace_16x); img.Images.Add("string", ve_resource.String_16x); img.Images.Add("checked", ve_resource.CheckBox_16x); img.Images.Add("content", ve_resource.TextContentControl_16x); g.ImageList = img; ExplorerForms ef = ExplorerForms.ef; VSSolution vs = ef.GetVSSolution(); if (vs == null) { MessageBox.Show("Open and build VS Solution first"); return; } ArrayList L = vs.GetExecutables(VSSolution.OutputType.both); foreach (string s in L) { TreeNode node = new TreeNode(Path.GetFileName(s)); node.ImageKey = "namespace"; g.Nodes.Add(node); if (!File.Exists(s)) { continue; } VSProject vpp = vs.GetProjectbyExec(s); if (vp != null) { if (vp != vpp) { continue; } } try { Assembly assembly = Assembly.LoadFrom(s); var namespaces = assembly.GetTypes() .Select(t => t.Namespace) .Distinct(); foreach (string c in namespaces) { TreeNode nodes = new TreeNode(c); nodes.ImageKey = "namespace"; node.Nodes.Add(nodes); var types = assembly.GetTypes() .Where(t => t.Namespace == c) .Distinct(); foreach (Type b in types) { TreeNode ng = new TreeNode(); ng.Text = b.Name; ng.ImageKey = "class"; DataSourceItem data = new DataSourceItem(); data.FileName = s; data.TypeName = b.Name; data.Namespace = b.Namespace; data.FullName = b.FullName; data.AssemblyQualifiedName = b.AssemblyQualifiedName; data.vs = vs; data.vp = vpp; ng.Tag = data; nodes.Nodes.Add(ng); var bb = b.GetMembers() .Where(t => t.MemberType == (MemberTypes.Property)); foreach (MemberInfo d in bb) { TreeNode bg = new TreeNode(" " + d.Name); bg.ImageKey = "string"; bg.Tag = d; ng.Nodes.Add(bg); if ((d as PropertyInfo).PropertyType.IsEnum || (d as PropertyInfo).PropertyType == typeof(bool)) { bg.ImageKey = "checked"; } else { bg.ImageKey = "content"; } } } } } catch (Exception ex) { continue; } } }
public static ArrayList FindInActiveDocument(string s) { // else if (bb == 2) //{ //MessageBox.Show("Find for Current Document"); ArrayList Results = new ArrayList(); ExplorerForms ef = ExplorerForms.ef; AvalonDocument doc = ef.scr.GetActiveDocument(); string filename = doc.FileName; string text = "doc.syntaxDocument1.Text"; string filenamedoc = filename; string patterns = s; //if (Results == null) { { { Finder finders = new Finder(); Results = new ArrayList(); //text = File.ReadAllText(f); //if (mc == false) { // text = text.ToLower(); // s = s.ToLower(); } char[] texts = text.ToCharArray(); char[] pattern = s.ToCharArray(); ArrayList found = null; //if (checkBox4.Checked == true) //{ // found = RegexMatch(text, s, true); //} //else { found = finders.TW(pattern, pattern.Length, texts, texts.Length); } if (found.Count > 0) { string[] lines = text.Split("\n".ToCharArray()); int fp = 0; int pos = (int)found[fp]; int r = 0; int n = 0; int i = 0; while (i < lines.Length) { string line = lines[i]; n = r + line.Length + 1; if (pos >= r && pos <= n) { do { Results.Add(filename + "\t" + (pos - r) + " \t" + i); fp++; if (fp < found.Count) { pos = (int)found[fp]; } else { break; } }while (pos <= n); } r = n; i++; } } } int act = 0; return(Results); } } //} return(Results); }
public void LoadEF(ExplorerForms c) { ef = c; ef.scr.activeDocument += Scr_activeDocument; }