Click here to Skip to main content
15,894,405 members
Articles / Database Development / SQL Server

Provider Design Patterns in NET 2.0

Rate me:
Please Sign up or sign in to vote.
4.96/5 (14 votes)
29 Oct 2008CPOL7 min read 72.7K   1K   86  
Provider Design Pattern is a new pattern that Microsoft formalized in .NET 2 to increase application performance where there is no need to explicitly instantiate classes.
namespace CompanyName.PhoneBook.PhoneBookApplication
{
    partial class AdvancedSearch
    {
        /// <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.groupBox1 = new System.Windows.Forms.GroupBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.checkBox3 = new System.Windows.Forms.CheckBox();
            this.chkTo = new System.Windows.Forms.CheckBox();
            this.chkFrom = new System.Windows.Forms.CheckBox();
            this.dateto = new System.Windows.Forms.DateTimePicker();
            this.datefrom = new System.Windows.Forms.DateTimePicker();
            this.cboGroup = new System.Windows.Forms.ComboBox();
            this.cboTeleTypes = new System.Windows.Forms.ComboBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.rdodesc = new System.Windows.Forms.RadioButton();
            this.rdoasc = new System.Windows.Forms.RadioButton();
            this.chkTele = new System.Windows.Forms.CheckBox();
            this.chkbirthdate = new System.Windows.Forms.CheckBox();
            this.chkGroup = new System.Windows.Forms.CheckBox();
            this.chkName = new System.Windows.Forms.CheckBox();
            this.cboName = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.txtTeleNumber = new System.Windows.Forms.TextBox();
            this.txtName = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.btnReset = new System.Windows.Forms.Button();
            this.btnsearch = new System.Windows.Forms.Button();
            this.grdvwPersons = new System.Windows.Forms.DataGridView();
            this.PersonId = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.personName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.personJobTitle = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.personGroup = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.pPhoneNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.pPhoneType = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.EditPersonInfo = new System.Windows.Forms.DataGridViewButtonColumn();
            this.btnshowdetails = new System.Windows.Forms.DataGridViewButtonColumn();
            this.btnRemove = new System.Windows.Forms.Button();
            this.progressBar = new System.Windows.Forms.ProgressBar();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdvwPersons)).BeginInit();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.groupBox2);
            this.groupBox1.Controls.Add(this.cboGroup);
            this.groupBox1.Controls.Add(this.cboTeleTypes);
            this.groupBox1.Controls.Add(this.groupBox3);
            this.groupBox1.Controls.Add(this.cboName);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Controls.Add(this.txtTeleNumber);
            this.groupBox1.Controls.Add(this.txtName);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Location = new System.Drawing.Point(12, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(894, 181);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Advanced Search";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.checkBox3);
            this.groupBox2.Controls.Add(this.chkTo);
            this.groupBox2.Controls.Add(this.chkFrom);
            this.groupBox2.Controls.Add(this.dateto);
            this.groupBox2.Controls.Add(this.datefrom);
            this.groupBox2.Location = new System.Drawing.Point(16, 78);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(383, 90);
            this.groupBox2.TabIndex = 9;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Birth Day";
            // 
            // checkBox3
            // 
            this.checkBox3.AutoSize = true;
            this.checkBox3.Location = new System.Drawing.Point(-170, 67);
            this.checkBox3.Name = "checkBox3";
            this.checkBox3.Size = new System.Drawing.Size(76, 17);
            this.checkBox3.TabIndex = 0;
            this.checkBox3.Text = "From Date";
            this.checkBox3.UseVisualStyleBackColor = true;
            // 
            // chkTo
            // 
            this.chkTo.AutoSize = true;
            this.chkTo.Location = new System.Drawing.Point(68, 50);
            this.chkTo.Name = "chkTo";
            this.chkTo.Size = new System.Drawing.Size(64, 17);
            this.chkTo.TabIndex = 8;
            this.chkTo.Text = "To Date";
            this.chkTo.UseVisualStyleBackColor = true;
            // 
            // chkFrom
            // 
            this.chkFrom.AutoSize = true;
            this.chkFrom.Location = new System.Drawing.Point(68, 19);
            this.chkFrom.Name = "chkFrom";
            this.chkFrom.Size = new System.Drawing.Size(76, 17);
            this.chkFrom.TabIndex = 6;
            this.chkFrom.Text = "From Date";
            this.chkFrom.UseVisualStyleBackColor = true;
            // 
            // dateto
            // 
            this.dateto.Location = new System.Drawing.Point(153, 47);
            this.dateto.Name = "dateto";
            this.dateto.Size = new System.Drawing.Size(217, 20);
            this.dateto.TabIndex = 9;
            // 
            // datefrom
            // 
            this.datefrom.Location = new System.Drawing.Point(153, 19);
            this.datefrom.Name = "datefrom";
            this.datefrom.Size = new System.Drawing.Size(217, 20);
            this.datefrom.TabIndex = 7;
            // 
            // cboGroup
            // 
            this.cboGroup.DisplayMember = "Mobile";
            this.cboGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboGroup.FormattingEnabled = true;
            this.cboGroup.Items.AddRange(new object[] {
            "ALL"});
            this.cboGroup.Location = new System.Drawing.Point(84, 51);
            this.cboGroup.Name = "cboGroup";
            this.cboGroup.Size = new System.Drawing.Size(302, 21);
            this.cboGroup.TabIndex = 3;
            this.cboGroup.ValueMember = "Mobile";
            // 
            // cboTeleTypes
            // 
            this.cboTeleTypes.DisplayMember = "Mobile";
            this.cboTeleTypes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTeleTypes.FormattingEnabled = true;
            this.cboTeleTypes.Items.AddRange(new object[] {
            "All",
            "Mobile",
            "Work",
            "Home"});
            this.cboTeleTypes.Location = new System.Drawing.Point(516, 26);
            this.cboTeleTypes.Name = "cboTeleTypes";
            this.cboTeleTypes.Size = new System.Drawing.Size(208, 21);
            this.cboTeleTypes.TabIndex = 4;
            this.cboTeleTypes.ValueMember = "Mobile";
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.rdodesc);
            this.groupBox3.Controls.Add(this.rdoasc);
            this.groupBox3.Controls.Add(this.chkTele);
            this.groupBox3.Controls.Add(this.chkbirthdate);
            this.groupBox3.Controls.Add(this.chkGroup);
            this.groupBox3.Controls.Add(this.chkName);
            this.groupBox3.Location = new System.Drawing.Point(420, 82);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(468, 86);
            this.groupBox3.TabIndex = 5;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Sorting By";
            // 
            // rdodesc
            // 
            this.rdodesc.AutoSize = true;
            this.rdodesc.Location = new System.Drawing.Point(96, 19);
            this.rdodesc.Name = "rdodesc";
            this.rdodesc.Size = new System.Drawing.Size(80, 17);
            this.rdodesc.TabIndex = 11;
            this.rdodesc.Text = "Descending";
            this.rdodesc.UseVisualStyleBackColor = true;
            // 
            // rdoasc
            // 
            this.rdoasc.AutoSize = true;
            this.rdoasc.Checked = true;
            this.rdoasc.Location = new System.Drawing.Point(16, 19);
            this.rdoasc.Name = "rdoasc";
            this.rdoasc.Size = new System.Drawing.Size(74, 17);
            this.rdoasc.TabIndex = 10;
            this.rdoasc.TabStop = true;
            this.rdoasc.Text = "Ascending";
            this.rdoasc.UseVisualStyleBackColor = true;
            // 
            // chkTele
            // 
            this.chkTele.AutoSize = true;
            this.chkTele.Location = new System.Drawing.Point(221, 52);
            this.chkTele.Name = "chkTele";
            this.chkTele.Size = new System.Drawing.Size(115, 17);
            this.chkTele.TabIndex = 15;
            this.chkTele.Text = "Telephone number";
            this.chkTele.UseVisualStyleBackColor = true;
            // 
            // chkbirthdate
            // 
            this.chkbirthdate.AutoSize = true;
            this.chkbirthdate.Location = new System.Drawing.Point(136, 51);
            this.chkbirthdate.Name = "chkbirthdate";
            this.chkbirthdate.Size = new System.Drawing.Size(74, 17);
            this.chkbirthdate.TabIndex = 14;
            this.chkbirthdate.Text = "Birth Date";
            this.chkbirthdate.UseVisualStyleBackColor = true;
            // 
            // chkGroup
            // 
            this.chkGroup.AutoSize = true;
            this.chkGroup.Checked = true;
            this.chkGroup.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkGroup.Location = new System.Drawing.Point(75, 51);
            this.chkGroup.Name = "chkGroup";
            this.chkGroup.Size = new System.Drawing.Size(55, 17);
            this.chkGroup.TabIndex = 13;
            this.chkGroup.Text = "Group";
            this.chkGroup.UseVisualStyleBackColor = true;
            // 
            // chkName
            // 
            this.chkName.AutoSize = true;
            this.chkName.Checked = true;
            this.chkName.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkName.Location = new System.Drawing.Point(16, 52);
            this.chkName.Name = "chkName";
            this.chkName.Size = new System.Drawing.Size(53, 17);
            this.chkName.TabIndex = 12;
            this.chkName.Text = "Name";
            this.chkName.UseVisualStyleBackColor = true;
            // 
            // cboName
            // 
            this.cboName.DisplayMember = "Mobile";
            this.cboName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboName.FormattingEnabled = true;
            this.cboName.Location = new System.Drawing.Point(84, 22);
            this.cboName.Name = "cboName";
            this.cboName.Size = new System.Drawing.Size(102, 21);
            this.cboName.TabIndex = 1;
            this.cboName.ValueMember = "Mobile";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(13, 53);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(36, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "Group";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(422, 58);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(67, 13);
            this.label4.TabIndex = 0;
            this.label4.Text = "Tele Number";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(422, 30);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(84, 13);
            this.label3.TabIndex = 0;
            this.label3.Text = "Telephone Type";
            // 
            // txtTeleNumber
            // 
            this.txtTeleNumber.Location = new System.Drawing.Point(516, 52);
            this.txtTeleNumber.Name = "txtTeleNumber";
            this.txtTeleNumber.Size = new System.Drawing.Size(208, 20);
            this.txtTeleNumber.TabIndex = 5;
            // 
            // txtName
            // 
            this.txtName.Location = new System.Drawing.Point(192, 23);
            this.txtName.Name = "txtName";
            this.txtName.Size = new System.Drawing.Size(194, 20);
            this.txtName.TabIndex = 2;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 26);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(34, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Name";
            // 
            // btnReset
            // 
            this.btnReset.Location = new System.Drawing.Point(685, 200);
            this.btnReset.Name = "btnReset";
            this.btnReset.Size = new System.Drawing.Size(75, 23);
            this.btnReset.TabIndex = 17;
            this.btnReset.Text = "Reset";
            this.btnReset.UseVisualStyleBackColor = true;
            this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
            // 
            // btnsearch
            // 
            this.btnsearch.Location = new System.Drawing.Point(12, 200);
            this.btnsearch.Name = "btnsearch";
            this.btnsearch.Size = new System.Drawing.Size(75, 23);
            this.btnsearch.TabIndex = 16;
            this.btnsearch.Text = "Search";
            this.btnsearch.UseVisualStyleBackColor = true;
            this.btnsearch.Click += new System.EventHandler(this.btnsearch_Click);
            // 
            // grdvwPersons
            // 
            this.grdvwPersons.AllowUserToAddRows = false;
            this.grdvwPersons.AllowUserToDeleteRows = false;
            this.grdvwPersons.AllowUserToOrderColumns = true;
            this.grdvwPersons.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdvwPersons.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.PersonId,
            this.personName,
            this.personJobTitle,
            this.personGroup,
            this.pPhoneNumber,
            this.pPhoneType,
            this.EditPersonInfo,
            this.btnshowdetails});
            this.grdvwPersons.Location = new System.Drawing.Point(12, 229);
            this.grdvwPersons.Name = "grdvwPersons";
            this.grdvwPersons.ReadOnly = true;
            this.grdvwPersons.Size = new System.Drawing.Size(894, 320);
            this.grdvwPersons.TabIndex = 19;
            this.grdvwPersons.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdvwPersons_CellClick);
            // 
            // PersonId
            // 
            this.PersonId.HeaderText = "Peron Id";
            this.PersonId.Name = "PersonId";
            this.PersonId.ReadOnly = true;
            this.PersonId.Visible = false;
            // 
            // personName
            // 
            this.personName.HeaderText = "Name";
            this.personName.Name = "personName";
            this.personName.ReadOnly = true;
            this.personName.Width = 180;
            // 
            // personJobTitle
            // 
            this.personJobTitle.HeaderText = "job Title";
            this.personJobTitle.Name = "personJobTitle";
            this.personJobTitle.ReadOnly = true;
            this.personJobTitle.Width = 150;
            // 
            // personGroup
            // 
            this.personGroup.HeaderText = "Group";
            this.personGroup.Name = "personGroup";
            this.personGroup.ReadOnly = true;
            this.personGroup.Width = 120;
            // 
            // pPhoneNumber
            // 
            this.pPhoneNumber.HeaderText = "Phone Number";
            this.pPhoneNumber.Name = "pPhoneNumber";
            this.pPhoneNumber.ReadOnly = true;
            // 
            // pPhoneType
            // 
            this.pPhoneType.HeaderText = "Phone Type";
            this.pPhoneType.Name = "pPhoneType";
            this.pPhoneType.ReadOnly = true;
            // 
            // EditPersonInfo
            // 
            this.EditPersonInfo.HeaderText = "Edit Info";
            this.EditPersonInfo.Name = "EditPersonInfo";
            this.EditPersonInfo.ReadOnly = true;
            this.EditPersonInfo.Text = "Edit";
            this.EditPersonInfo.UseColumnTextForButtonValue = true;
            // 
            // btnshowdetails
            // 
            this.btnshowdetails.HeaderText = "Show Details";
            this.btnshowdetails.Name = "btnshowdetails";
            this.btnshowdetails.ReadOnly = true;
            this.btnshowdetails.Text = "Details";
            this.btnshowdetails.UseColumnTextForButtonValue = true;
            // 
            // btnRemove
            // 
            this.btnRemove.Location = new System.Drawing.Point(766, 200);
            this.btnRemove.Name = "btnRemove";
            this.btnRemove.Size = new System.Drawing.Size(140, 23);
            this.btnRemove.TabIndex = 18;
            this.btnRemove.Text = "Remove Selected";
            this.btnRemove.UseVisualStyleBackColor = true;
            this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
            // 
            // progressBar
            // 
            this.progressBar.Location = new System.Drawing.Point(96, 200);
            this.progressBar.Name = "progressBar";
            this.progressBar.Size = new System.Drawing.Size(583, 23);
            this.progressBar.TabIndex = 20;
            // 
            // AdvancedSearch
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(943, 561);
            this.Controls.Add(this.progressBar);
            this.Controls.Add(this.grdvwPersons);
            this.Controls.Add(this.btnRemove);
            this.Controls.Add(this.btnReset);
            this.Controls.Add(this.btnsearch);
            this.Controls.Add(this.groupBox1);
            this.HelpButton = true;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "AdvancedSearch";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "AdvancedSearch";
            this.Load += new System.EventHandler(this.AdvancedSearch_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdvwPersons)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.DateTimePicker datefrom;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtName;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox cboName;
        private System.Windows.Forms.ComboBox cboGroup;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.CheckBox checkBox3;
        private System.Windows.Forms.CheckBox chkTo;
        private System.Windows.Forms.CheckBox chkFrom;
        private System.Windows.Forms.DateTimePicker dateto;
        private System.Windows.Forms.ComboBox cboTeleTypes;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox txtTeleNumber;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Button btnReset;
        private System.Windows.Forms.Button btnsearch;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.RadioButton rdodesc;
        private System.Windows.Forms.RadioButton rdoasc;
        private System.Windows.Forms.CheckBox chkTele;
        private System.Windows.Forms.CheckBox chkGroup;
        private System.Windows.Forms.CheckBox chkName;
        private System.Windows.Forms.CheckBox chkbirthdate;
        private System.Windows.Forms.DataGridView grdvwPersons;
        private System.Windows.Forms.Button btnRemove;
        private System.Windows.Forms.DataGridViewTextBoxColumn PersonId;
        private System.Windows.Forms.DataGridViewTextBoxColumn personName;
        private System.Windows.Forms.DataGridViewTextBoxColumn personJobTitle;
        private System.Windows.Forms.DataGridViewTextBoxColumn personGroup;
        private System.Windows.Forms.DataGridViewTextBoxColumn pPhoneNumber;
        private System.Windows.Forms.DataGridViewTextBoxColumn pPhoneType;
        private System.Windows.Forms.DataGridViewButtonColumn EditPersonInfo;
        private System.Windows.Forms.DataGridViewButtonColumn btnshowdetails;
        private System.Windows.Forms.ProgressBar progressBar;
    }
}

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 Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Egypt Egypt
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions