using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Text; using System.Windows.Forms; using System.CodeDom; using System.CodeDom.Compiler; using System.Runtime.CompilerServices; using System.Reflection; using System.Xml; using Microsoft.CSharp; namespace DarkWynter.Shell { public class UCAD_Button : Button { string objectName = ""; private UserControl userControl; public UCAD_Button(XmlNode buttonNode, Point location, Assembly assembly) { // "Class name, relative to the Tab namespace attribute" objectName = buttonNode.Attributes["objectName"].Value; if (objectName != "") { // Get the User Control from the Assembly. userControl = (UserControl)assembly.CreateInstance(objectName); } // "Text applied to the button surface" this.Text = buttonNode.Attributes["buttonText"].Value; // Special Event handler calls userControl this.Click += new System.EventHandler(UCAD.button_Click); // Set location of the button this.Location = location; this.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.FlatAppearance.BorderColor = System.Drawing.Color.LightSeaGreen; this.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.Font = new System.Drawing.Font("Verdana", 9.00F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ForeColor = UCAD_Settings.defaultForeColor; this.BackColor = UCAD_Settings.defaultBackColor; this.Name = "button_" + objectName; this.Size = new System.Drawing.Size(87, 25); this.TabIndex = 3; } public void ConfigureStyle() { } public UserControl GetUserControl() { return userControl; } public void ActivateButton(UCAD_Button button) { // Colorize the Selected Button button.BackColor = UCAD_Settings.onClickBackColor; button.ForeColor = UCAD_Settings.onClickForeColor; } } }