home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
-
- namespace TaskPane
- {
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- public class Form1 : System.Windows.Forms.Form
- {
- private NETXP.Controls.TaskPane.XPTaskPane xpTaskPane1;
- private NETXP.Controls.TaskPane.XPTaskPaneGroup xpTaskPaneGroup1;
- private NETXP.Controls.TaskPane.XPTaskPaneGroup xpTaskPaneGroup2;
- private NETXP.Controls.TaskPane.XPLink xpLink1;
- private NETXP.Controls.TaskPane.XPLink xpLink2;
- private NETXP.Controls.TaskPane.XPLink xpLink3;
- private NETXP.Controls.TaskPane.XPLink xpLink4;
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Splitter splitter1;
- private System.Windows.Forms.RadioButton radioButton1;
- private System.Windows.Forms.RadioButton radioButton2;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public Form1()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (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()
- {
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
- this.xpTaskPane1 = new NETXP.Controls.TaskPane.XPTaskPane();
- this.xpTaskPaneGroup2 = new NETXP.Controls.TaskPane.XPTaskPaneGroup();
- this.xpLink2 = new NETXP.Controls.TaskPane.XPLink();
- this.xpLink1 = new NETXP.Controls.TaskPane.XPLink();
- this.xpTaskPaneGroup1 = new NETXP.Controls.TaskPane.XPTaskPaneGroup();
- this.xpLink4 = new NETXP.Controls.TaskPane.XPLink();
- this.xpLink3 = new NETXP.Controls.TaskPane.XPLink();
- this.panel1 = new System.Windows.Forms.Panel();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.splitter1 = new System.Windows.Forms.Splitter();
- this.xpTaskPane1.SuspendLayout();
- this.xpTaskPaneGroup2.SuspendLayout();
- this.xpTaskPaneGroup1.SuspendLayout();
- this.panel1.SuspendLayout();
- this.SuspendLayout();
- //
- // xpTaskPane1
- //
- this.xpTaskPane1.AutoScroll = true;
- this.xpTaskPane1.Controls.Add(this.xpTaskPaneGroup2);
- this.xpTaskPane1.Controls.Add(this.xpTaskPaneGroup1);
- this.xpTaskPane1.Dock = System.Windows.Forms.DockStyle.Left;
- this.xpTaskPane1.Location = new System.Drawing.Point(0, 0);
- this.xpTaskPane1.Name = "xpTaskPane1";
- this.xpTaskPane1.Size = new System.Drawing.Size(200, 414);
- this.xpTaskPane1.TabIndex = 0;
- this.xpTaskPane1.Text = "xpTaskPane1";
- //
- // xpTaskPaneGroup2
- //
- this.xpTaskPaneGroup2.Controls.Add(this.xpLink2);
- this.xpTaskPaneGroup2.Controls.Add(this.xpLink1);
- this.xpTaskPaneGroup2.Image = ((System.Drawing.Image)(resources.GetObject("xpTaskPaneGroup2.Image")));
- this.xpTaskPaneGroup2.Location = new System.Drawing.Point(16, 128);
- this.xpTaskPaneGroup2.Name = "xpTaskPaneGroup2";
- this.xpTaskPaneGroup2.Size = new System.Drawing.Size(168, 80);
- this.xpTaskPaneGroup2.TabIndex = 1;
- this.xpTaskPaneGroup2.Text = "Normal Tasks";
- //
- // xpLink2
- //
- this.xpLink2.BackColor = System.Drawing.Color.Transparent;
- this.xpLink2.Cursor = System.Windows.Forms.Cursors.Hand;
- this.xpLink2.Image = ((System.Drawing.Image)(resources.GetObject("xpLink2.Image")));
- this.xpLink2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.xpLink2.Location = new System.Drawing.Point(8, 56);
- this.xpLink2.Name = "xpLink2";
- this.xpLink2.Size = new System.Drawing.Size(136, 16);
- this.xpLink2.TabIndex = 1;
- this.xpLink2.Text = "Connect to Network";
- this.xpLink2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // xpLink1
- //
- this.xpLink1.BackColor = System.Drawing.Color.Transparent;
- this.xpLink1.Cursor = System.Windows.Forms.Cursors.Hand;
- this.xpLink1.Image = ((System.Drawing.Image)(resources.GetObject("xpLink1.Image")));
- this.xpLink1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.xpLink1.Location = new System.Drawing.Point(8, 32);
- this.xpLink1.Name = "xpLink1";
- this.xpLink1.Size = new System.Drawing.Size(136, 16);
- this.xpLink1.TabIndex = 0;
- this.xpLink1.Text = "Clean Hard Disk";
- this.xpLink1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // xpTaskPaneGroup1
- //
- this.xpTaskPaneGroup1.Controls.Add(this.xpLink4);
- this.xpTaskPaneGroup1.Controls.Add(this.xpLink3);
- this.xpTaskPaneGroup1.Image = ((System.Drawing.Image)(resources.GetObject("xpTaskPaneGroup1.Image")));
- this.xpTaskPaneGroup1.Location = new System.Drawing.Point(16, 16);
- this.xpTaskPaneGroup1.Name = "xpTaskPaneGroup1";
- this.xpTaskPaneGroup1.Size = new System.Drawing.Size(168, 88);
- this.xpTaskPaneGroup1.SpecialTasks = true;
- this.xpTaskPaneGroup1.TabIndex = 0;
- this.xpTaskPaneGroup1.Text = "Special Tasks";
- //
- // xpLink4
- //
- this.xpLink4.BackColor = System.Drawing.Color.Transparent;
- this.xpLink4.Cursor = System.Windows.Forms.Cursors.Hand;
- this.xpLink4.Image = ((System.Drawing.Image)(resources.GetObject("xpLink4.Image")));
- this.xpLink4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.xpLink4.Location = new System.Drawing.Point(8, 64);
- this.xpLink4.Name = "xpLink4";
- this.xpLink4.Size = new System.Drawing.Size(144, 16);
- this.xpLink4.TabIndex = 1;
- this.xpLink4.Text = "Disk Backup";
- this.xpLink4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // xpLink3
- //
- this.xpLink3.BackColor = System.Drawing.Color.Transparent;
- this.xpLink3.Cursor = System.Windows.Forms.Cursors.Hand;
- this.xpLink3.Image = ((System.Drawing.Image)(resources.GetObject("xpLink3.Image")));
- this.xpLink3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.xpLink3.Location = new System.Drawing.Point(8, 40);
- this.xpLink3.Name = "xpLink3";
- this.xpLink3.Size = new System.Drawing.Size(144, 16);
- this.xpLink3.TabIndex = 0;
- this.xpLink3.Text = "Open Shortcut";
- this.xpLink3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.SystemColors.Window;
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.panel1.Controls.Add(this.radioButton2);
- this.panel1.Controls.Add(this.radioButton1);
- this.panel1.Controls.Add(this.splitter1);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Location = new System.Drawing.Point(200, 0);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(360, 414);
- this.panel1.TabIndex = 1;
- //
- // radioButton2
- //
- this.radioButton2.Location = new System.Drawing.Point(64, 72);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(168, 24);
- this.radioButton2.TabIndex = 2;
- this.radioButton2.Text = "Custom Colors";
- this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
- //
- // radioButton1
- //
- this.radioButton1.Checked = true;
- this.radioButton1.Location = new System.Drawing.Point(64, 48);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(168, 24);
- this.radioButton1.TabIndex = 1;
- this.radioButton1.TabStop = true;
- this.radioButton1.Text = "Windows Default Colors";
- this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
- //
- // splitter1
- //
- this.splitter1.Location = new System.Drawing.Point(0, 0);
- this.splitter1.Name = "splitter1";
- this.splitter1.Size = new System.Drawing.Size(3, 410);
- this.splitter1.TabIndex = 0;
- this.splitter1.TabStop = false;
- //
- // Form1
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(560, 414);
- this.Controls.Add(this.panel1);
- this.Controls.Add(this.xpTaskPane1);
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "Form1";
- this.Text = "Test Form";
- this.Load += new System.EventHandler(this.Form1_Load);
- this.xpTaskPane1.ResumeLayout(false);
- this.xpTaskPaneGroup2.ResumeLayout(false);
- this.xpTaskPaneGroup1.ResumeLayout(false);
- this.panel1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.Run(new Form1());
- }
-
- private void Form1_Load(object sender, System.EventArgs e)
- {
- }
-
- private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
- {
- if(radioButton1.Checked)
- {
- this.xpTaskPane1.ColorTable = NETXP.Library.ColorTables.Dynamic;
- }
- }
-
- private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
- {
- if(radioButton2.Checked)
- {
- this.xpTaskPane1.ColorTable = new CustomColors();
- }
- }
- }
- internal class CustomColors : NETXP.Library.IColorTable
- {
- #region IColorTable Members
-
- private NETXP.Library.ColorCollection colors;
-
- public CustomColors()
- {
- colors = new NETXP.Library.ColorCollection();
- foreach(Color clr in NETXP.Library.ColorTables.XPOlive.Colors)
- {
- colors.Add(Color.FromArgb(clr.G, clr.B, clr.B));
- }
- }
-
- public NETXP.Library.ColorCollection Colors
- {
- get
- {
- return colors;
- }
- }
-
- #endregion
- }
- }
-