DoingStuff.cs

00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Drawing;
00005 using System.Data;
00006 using System.Text;
00007 using System.Windows.Forms;
00008 
00009 namespace SimpleControls
00010 {
00014     public partial class DoingStuff : UserControl
00015     {
00017         private int position = 0;
00018 
00022         public DoingStuff()
00023         {
00024             InitializeComponent();
00025         }
00026 
00030         [
00031             TypeConverter(typeof(PleaseWait)),
00032             Category("Appearance"),
00033             Description("Wether or not you wish the animation to be enabled")
00034         ]
00035         public bool DoStuff
00036         {
00037             get { return timAnimator.Enabled; }
00038             set { timAnimator.Enabled = value; }
00039         }
00040 
00044         public void Begin()
00045         {
00046             this.Visible = true;
00047             timAnimator.Enabled = true;
00048         }
00049 
00053         public void End()
00054         {
00055             this.Visible = false;
00056             timAnimator.Enabled = false;
00057         }
00058 
00064         private void timAnimator_Tick(object sender, EventArgs e)
00065         {
00066             // Just make sure we're not moving the animation further than what we've got frames for
00067             if (position == 15)
00068                 position = 0;
00069             else
00070                 position++;
00071 
00072             // Move the animation to the current frame
00073             picAnim.Top = position * -16;
00074         }
00075     }
00076 }

Generated on Thu Dec 21 06:21:56 2006 for SCRAML by  doxygen 1.5.1-p1