Click here to Skip to main content
15,884,099 members
Articles / Desktop Programming / Windows Forms

Plug-ins in C# 2.0: Generics Enabled Extension Library

Rate me:
Please Sign up or sign in to vote.
4.67/5 (39 votes)
7 Nov 2007CPOL7 min read 92.5K   1.3K   139  
A follow up to my previous article, this article takes the plug-in concept and encapsulates it in a Generics enabled library, including support for source code compilation at runtime.
namespace ExtensionThree
{
	partial class frmInput
	{
		/// <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.label1 = new System.Windows.Forms.Label();
			this.textData = new System.Windows.Forms.TextBox();
			this.buttonOK = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(12, 9);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(86, 13);
			this.label1.TabIndex = 0;
			this.label1.Text = "Enter something:";
			// 
			// textData
			// 
			this.textData.Location = new System.Drawing.Point(15, 25);
			this.textData.Name = "textData";
			this.textData.Size = new System.Drawing.Size(250, 20);
			this.textData.TabIndex = 1;
			// 
			// buttonOK
			// 
			this.buttonOK.Location = new System.Drawing.Point(190, 51);
			this.buttonOK.Name = "buttonOK";
			this.buttonOK.Size = new System.Drawing.Size(75, 23);
			this.buttonOK.TabIndex = 2;
			this.buttonOK.Text = "OK";
			this.buttonOK.UseVisualStyleBackColor = true;
			this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
			// 
			// frmInput
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(277, 89);
			this.ControlBox = false;
			this.Controls.Add(this.buttonOK);
			this.Controls.Add(this.textData);
			this.Controls.Add(this.label1);
			this.Name = "frmInput";
			this.Text = "Input";
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox textData;
		private System.Windows.Forms.Button buttonOK;
	}
}

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
Web Developer
Canada Canada
Currently I'm an Oracle DBA for a School Board, having recently completed my undergrad at the University of Guelph with a Bachelor of Computing.

I obviously enjoy programming Smile | :)

Contact Me:
(MSN: jondick at gmail dot com)
(IRC: Dalnet: #c#, #asp.net, #vb.net)
(IRC: FreeNode: #linuxpeople)

Comments and Discussions