Click here to Skip to main content
15,897,371 members
Articles / Desktop Programming / Windows Forms

C# and VB.NET Code Searcher - Using Roslyn

Rate me:
Please Sign up or sign in to vote.
4.84/5 (51 votes)
7 Mar 2013LGPL314 min read 202.5K   5.6K   130  
A fast C# and VB.NET code searcher using Roslyn.
namespace RoslynCodeSearcher
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnSearch = new System.Windows.Forms.Button();
            this.txtTextToSearch = new System.Windows.Forms.TextBox();
            this.rbSearchTextInMethod = new System.Windows.Forms.RadioButton();
            this.rbSearchCallers = new System.Windows.Forms.RadioButton();
            this.grpSearch = new System.Windows.Forms.GroupBox();
            this.rbSearchClasses = new System.Windows.Forms.RadioButton();
            this.rbSearchProperties = new System.Windows.Forms.RadioButton();
            this.rbSearchMethods = new System.Windows.Forms.RadioButton();
            this.btnBrowse = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.btnUpdateSolutionList = new System.Windows.Forms.Button();
            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.txtExclude = new System.Windows.Forms.TextBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.txtInclude = new System.Windows.Forms.TextBox();
            this.btnNewTab = new System.Windows.Forms.Button();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.label1 = new System.Windows.Forms.Label();
            this.prbCompilationProgress = new System.Windows.Forms.ProgressBar();
            this.cbPartOfText = new System.Windows.Forms.CheckBox();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.rbCSharp = new System.Windows.Forms.RadioButton();
            this.rbVB = new System.Windows.Forms.RadioButton();
            this.lblDone = new System.Windows.Forms.Label();
            this.krbTabControl1 = new KRBTabControl.KRBTabControl();
            this.tabPageEx1 = new KRBTabControl.TabPageEx();
            this.rbSearchText = new System.Windows.Forms.RadioButton();
            this.grpSearch.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.krbTabControl1.SuspendLayout();
            this.SuspendLayout();
            // 
            // btnSearch
            // 
            this.btnSearch.Location = new System.Drawing.Point(265, 15);
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.Size = new System.Drawing.Size(75, 23);
            this.btnSearch.TabIndex = 30;
            this.btnSearch.Text = "Search";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
            // 
            // txtTextToSearch
            // 
            this.txtTextToSearch.Location = new System.Drawing.Point(7, 15);
            this.txtTextToSearch.Name = "txtTextToSearch";
            this.txtTextToSearch.Size = new System.Drawing.Size(250, 20);
            this.txtTextToSearch.TabIndex = 10;
            // 
            // rbSearchTextInMethod
            // 
            this.rbSearchTextInMethod.AutoSize = true;
            this.rbSearchTextInMethod.Location = new System.Drawing.Point(6, 41);
            this.rbSearchTextInMethod.Name = "rbSearchTextInMethod";
            this.rbSearchTextInMethod.Size = new System.Drawing.Size(129, 17);
            this.rbSearchTextInMethod.TabIndex = 21;
            this.rbSearchTextInMethod.TabStop = true;
            this.rbSearchTextInMethod.Text = "Search text in Method";
            this.rbSearchTextInMethod.UseVisualStyleBackColor = true;
            this.rbSearchTextInMethod.CheckedChanged += new System.EventHandler(this.rbSearchTextInMethod_CheckedChanged);
            // 
            // rbSearchCallers
            // 
            this.rbSearchCallers.AutoSize = true;
            this.rbSearchCallers.Location = new System.Drawing.Point(6, 63);
            this.rbSearchCallers.Name = "rbSearchCallers";
            this.rbSearchCallers.Size = new System.Drawing.Size(83, 17);
            this.rbSearchCallers.TabIndex = 22;
            this.rbSearchCallers.TabStop = true;
            this.rbSearchCallers.Text = "Search calls";
            this.rbSearchCallers.UseVisualStyleBackColor = true;
            // 
            // grpSearch
            // 
            this.grpSearch.Controls.Add(this.rbSearchText);
            this.grpSearch.Controls.Add(this.rbSearchClasses);
            this.grpSearch.Controls.Add(this.rbSearchProperties);
            this.grpSearch.Controls.Add(this.rbSearchMethods);
            this.grpSearch.Controls.Add(this.rbSearchTextInMethod);
            this.grpSearch.Controls.Add(this.rbSearchCallers);
            this.grpSearch.Location = new System.Drawing.Point(348, 6);
            this.grpSearch.Name = "grpSearch";
            this.grpSearch.Size = new System.Drawing.Size(136, 149);
            this.grpSearch.TabIndex = 20;
            this.grpSearch.TabStop = false;
            this.grpSearch.Text = "Search method";
            // 
            // rbSearchClasses
            // 
            this.rbSearchClasses.AutoSize = true;
            this.rbSearchClasses.Location = new System.Drawing.Point(6, 127);
            this.rbSearchClasses.Name = "rbSearchClasses";
            this.rbSearchClasses.Size = new System.Drawing.Size(97, 17);
            this.rbSearchClasses.TabIndex = 25;
            this.rbSearchClasses.TabStop = true;
            this.rbSearchClasses.Text = "Search classes";
            this.rbSearchClasses.UseVisualStyleBackColor = true;
            // 
            // rbSearchProperties
            // 
            this.rbSearchProperties.AutoSize = true;
            this.rbSearchProperties.Location = new System.Drawing.Point(6, 105);
            this.rbSearchProperties.Name = "rbSearchProperties";
            this.rbSearchProperties.Size = new System.Drawing.Size(108, 17);
            this.rbSearchProperties.TabIndex = 24;
            this.rbSearchProperties.TabStop = true;
            this.rbSearchProperties.Text = "Search properties";
            this.rbSearchProperties.UseVisualStyleBackColor = true;
            // 
            // rbSearchMethods
            // 
            this.rbSearchMethods.AutoSize = true;
            this.rbSearchMethods.Location = new System.Drawing.Point(6, 84);
            this.rbSearchMethods.Name = "rbSearchMethods";
            this.rbSearchMethods.Size = new System.Drawing.Size(102, 17);
            this.rbSearchMethods.TabIndex = 23;
            this.rbSearchMethods.TabStop = true;
            this.rbSearchMethods.Text = "Search methods";
            this.rbSearchMethods.UseVisualStyleBackColor = true;
            // 
            // btnBrowse
            // 
            this.btnBrowse.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnBrowse.Location = new System.Drawing.Point(16, 19);
            this.btnBrowse.Name = "btnBrowse";
            this.btnBrowse.Size = new System.Drawing.Size(75, 23);
            this.btnBrowse.TabIndex = 31;
            this.btnBrowse.Text = "Browse ...";
            this.btnBrowse.UseVisualStyleBackColor = true;
            this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.btnUpdateSolutionList);
            this.groupBox1.Controls.Add(this.btnBrowse);
            this.groupBox1.Location = new System.Drawing.Point(491, 6);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(148, 130);
            this.groupBox1.TabIndex = 32;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Starting Directory";
            // 
            // btnUpdateSolutionList
            // 
            this.btnUpdateSolutionList.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnUpdateSolutionList.Location = new System.Drawing.Point(16, 54);
            this.btnUpdateSolutionList.Name = "btnUpdateSolutionList";
            this.btnUpdateSolutionList.Size = new System.Drawing.Size(121, 23);
            this.btnUpdateSolutionList.TabIndex = 32;
            this.btnUpdateSolutionList.Text = "Update solution List";
            this.btnUpdateSolutionList.UseVisualStyleBackColor = true;
            this.btnUpdateSolutionList.Click += new System.EventHandler(this.btnUpdateSolutionList_Click);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.txtExclude);
            this.groupBox2.Location = new System.Drawing.Point(646, 6);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(249, 120);
            this.groupBox2.TabIndex = 35;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Do not include files containing words in filename. Separate by comma.";
            // 
            // txtExclude
            // 
            this.txtExclude.Location = new System.Drawing.Point(8, 31);
            this.txtExclude.Multiline = true;
            this.txtExclude.Name = "txtExclude";
            this.txtExclude.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.txtExclude.Size = new System.Drawing.Size(230, 67);
            this.txtExclude.TabIndex = 34;
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.txtInclude);
            this.groupBox3.Location = new System.Drawing.Point(903, 6);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(234, 120);
            this.groupBox3.TabIndex = 36;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Only include files containing word in filename. Separate by comma.";
            // 
            // txtInclude
            // 
            this.txtInclude.Location = new System.Drawing.Point(11, 31);
            this.txtInclude.Multiline = true;
            this.txtInclude.Name = "txtInclude";
            this.txtInclude.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.txtInclude.Size = new System.Drawing.Size(211, 67);
            this.txtInclude.TabIndex = 35;
            // 
            // btnNewTab
            // 
            this.btnNewTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnNewTab.Location = new System.Drawing.Point(265, 87);
            this.btnNewTab.Name = "btnNewTab";
            this.btnNewTab.Size = new System.Drawing.Size(75, 23);
            this.btnNewTab.TabIndex = 33;
            this.btnNewTab.Text = "New tab";
            this.btnNewTab.UseVisualStyleBackColor = true;
            this.btnNewTab.Click += new System.EventHandler(this.btnNewTab_Click);
            // 
            // splitContainer1
            // 
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.label1);
            this.splitContainer1.Panel1.Controls.Add(this.prbCompilationProgress);
            this.splitContainer1.Panel1.Controls.Add(this.cbPartOfText);
            this.splitContainer1.Panel1.Controls.Add(this.groupBox4);
            this.splitContainer1.Panel1.Controls.Add(this.lblDone);
            this.splitContainer1.Panel1.Controls.Add(this.txtTextToSearch);
            this.splitContainer1.Panel1.Controls.Add(this.btnNewTab);
            this.splitContainer1.Panel1.Controls.Add(this.btnSearch);
            this.splitContainer1.Panel1.Controls.Add(this.groupBox3);
            this.splitContainer1.Panel1.Controls.Add(this.grpSearch);
            this.splitContainer1.Panel1.Controls.Add(this.groupBox2);
            this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.krbTabControl1);
            this.splitContainer1.Size = new System.Drawing.Size(1563, 454);
            this.splitContainer1.SplitterDistance = 158;
            this.splitContainer1.TabIndex = 38;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(120, 80);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(107, 13);
            this.label1.TabIndex = 39;
            this.label1.Text = "Compilation progress:";
            // 
            // prbCompilationProgress
            // 
            this.prbCompilationProgress.Location = new System.Drawing.Point(117, 103);
            this.prbCompilationProgress.Minimum = 1;
            this.prbCompilationProgress.Name = "prbCompilationProgress";
            this.prbCompilationProgress.Size = new System.Drawing.Size(130, 23);
            this.prbCompilationProgress.TabIndex = 38;
            this.prbCompilationProgress.Value = 1;
            // 
            // cbPartOfText
            // 
            this.cbPartOfText.AutoSize = true;
            this.cbPartOfText.Location = new System.Drawing.Point(117, 50);
            this.cbPartOfText.Name = "cbPartOfText";
            this.cbPartOfText.Size = new System.Drawing.Size(162, 17);
            this.cbPartOfText.TabIndex = 0;
            this.cbPartOfText.Text = "Search part of text (contains)";
            this.cbPartOfText.UseVisualStyleBackColor = true;
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.rbCSharp);
            this.groupBox4.Controls.Add(this.rbVB);
            this.groupBox4.Location = new System.Drawing.Point(7, 45);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(98, 65);
            this.groupBox4.TabIndex = 33;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Language";
            // 
            // rbCSharp
            // 
            this.rbCSharp.AutoSize = true;
            this.rbCSharp.Checked = true;
            this.rbCSharp.Location = new System.Drawing.Point(13, 17);
            this.rbCSharp.Name = "rbCSharp";
            this.rbCSharp.Size = new System.Drawing.Size(39, 17);
            this.rbCSharp.TabIndex = 23;
            this.rbCSharp.TabStop = true;
            this.rbCSharp.Text = "C#";
            this.rbCSharp.UseVisualStyleBackColor = true;
            // 
            // rbVB
            // 
            this.rbVB.AutoSize = true;
            this.rbVB.Location = new System.Drawing.Point(13, 41);
            this.rbVB.Name = "rbVB";
            this.rbVB.Size = new System.Drawing.Size(64, 17);
            this.rbVB.TabIndex = 24;
            this.rbVB.Text = "VB.NET";
            this.rbVB.UseVisualStyleBackColor = true;
            // 
            // lblDone
            // 
            this.lblDone.AutoSize = true;
            this.lblDone.Location = new System.Drawing.Point(10, 50);
            this.lblDone.Name = "lblDone";
            this.lblDone.Size = new System.Drawing.Size(10, 13);
            this.lblDone.TabIndex = 37;
            this.lblDone.Text = " ";
            // 
            // krbTabControl1
            // 
            this.krbTabControl1.AllowDrop = true;
            this.krbTabControl1.BackgroundHatcher.HatchType = System.Drawing.Drawing2D.HatchStyle.DashedVertical;
            this.krbTabControl1.Controls.Add(this.tabPageEx1);
            this.krbTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.krbTabControl1.IsDocumentTabStyle = true;
            this.krbTabControl1.IsDrawTabSeparator = true;
            this.krbTabControl1.ItemSize = new System.Drawing.Size(0, 26);
            this.krbTabControl1.Location = new System.Drawing.Point(0, 0);
            this.krbTabControl1.Name = "krbTabControl1";
            this.krbTabControl1.SelectedIndex = 0;
            this.krbTabControl1.Size = new System.Drawing.Size(1563, 292);
            this.krbTabControl1.TabGradient.ColorEnd = System.Drawing.Color.Gainsboro;
            this.krbTabControl1.TabIndex = 38;
            this.krbTabControl1.UpDownStyle = KRBTabControl.KRBTabControl.UpDown32Style.Default;
            this.krbTabControl1.TabPageClosing += new System.EventHandler<KRBTabControl.KRBTabControl.SelectedIndexChangingEventArgs>(this.krbTabControl1_TabPageClosing);
            // 
            // tabPageEx1
            // 
            this.tabPageEx1.BackColor = System.Drawing.Color.White;
            this.tabPageEx1.Font = new System.Drawing.Font("Arial", 10F);
            this.tabPageEx1.Guid = new System.Guid("00000000-0000-0000-0000-000000000000");
            this.tabPageEx1.Location = new System.Drawing.Point(1, 32);
            this.tabPageEx1.Name = "tabPageEx1";
            this.tabPageEx1.Size = new System.Drawing.Size(1561, 238);
            this.tabPageEx1.TabIndex = 0;
            this.tabPageEx1.Text = "";
            // 
            // rbSearchText
            // 
            this.rbSearchText.AutoSize = true;
            this.rbSearchText.Location = new System.Drawing.Point(6, 18);
            this.rbSearchText.Name = "rbSearchText";
            this.rbSearchText.Size = new System.Drawing.Size(79, 17);
            this.rbSearchText.TabIndex = 26;
            this.rbSearchText.TabStop = true;
            this.rbSearchText.Text = "Search text";
            this.rbSearchText.UseVisualStyleBackColor = true;
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1563, 454);
            this.Controls.Add(this.splitContainer1);
            this.Name = "Form1";
            this.Text = "RoslynCodeSearcher";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.Load += new System.EventHandler(this.Form1_Load);
            this.grpSearch.ResumeLayout(false);
            this.grpSearch.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel1.PerformLayout();
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            this.krbTabControl1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button btnSearch;
        private System.Windows.Forms.TextBox txtTextToSearch;
        private System.Windows.Forms.RadioButton rbSearchTextInMethod;
        private System.Windows.Forms.RadioButton rbSearchCallers;
        private System.Windows.Forms.GroupBox grpSearch;
        private System.Windows.Forms.RadioButton rbSearchMethods;
        private System.Windows.Forms.Button btnBrowse;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
        private System.Windows.Forms.Button btnUpdateSolutionList;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.TextBox txtExclude;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.TextBox txtInclude;
        private System.Windows.Forms.Button btnNewTab;
        private System.Windows.Forms.SplitContainer splitContainer1;
        private KRBTabControl.KRBTabControl krbTabControl1;
        private KRBTabControl.TabPageEx tabPageEx1;
        private System.Windows.Forms.Label lblDone;
        private System.Windows.Forms.RadioButton rbSearchProperties;
        private System.Windows.Forms.RadioButton rbSearchClasses;
        private System.Windows.Forms.GroupBox groupBox4;
        private System.Windows.Forms.RadioButton rbCSharp;
        private System.Windows.Forms.RadioButton rbVB;
        private System.Windows.Forms.CheckBox cbPartOfText;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ProgressBar prbCompilationProgress;
        private System.Windows.Forms.RadioButton rbSearchText;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior)
Netherlands Netherlands
Languages: C#, ASP.NET, HTML, VB, Javascript.
Tools: Visual Studio 2010, 2012.
Databases: MS SQL Server, Oracle, SQLite.
Skills: MCPD Web Developer 4.0, MCSD 2.0
Likes: Solving problems at projecteuler.net. at #66 now.
Technologies:C#, Azure, Xamarin.iOS, Web API, T/SQL, PL/SQL, MSBuild, WIX, XSLT, WPF, WCF, JavaScript

I have been a programmer since 1995. At first at school where we had a computer club with nice Aster CT-80 (TRS-80 clone) computers and 1 MSX computer where I learned to program in BASIC. Later I had my own 8086 XT computer.
My first experience with programming was way before that when I was about 8. A friend of mine had a Commodore 64. He typed over a BASIC game from a computing magazine. The program worked but it contained an error. The thing he did was go to the source line that caused the error, deleted the line, and restarted the program. It worked every time he got an error...

Comments and Discussions