Files
mono/mcs/class/System.Windows.Forms/Gtk/Timer.cs
T
Joel Basson 802417f479 Thu Jan 16 19:20:00 GMT+2 2003 Joel Basson <[email protected]>
* Applied patch from Alberto Fernandez with the following changes...
	Finished ProgressBar (Events?)
	Finished HScrollBar VScrollBar and ScrollBar
	Finished FolderBrowserDialog
	Base ComboBox
	Added DrawMode.cs
	Added ComboBoxStyle.cs
	Added Appearance.cs
	Added CheckState.cs
	Added TabAlignment
	Added TabAppearance.cs
	Added TabDrawMode.cs
	Added TabSizeMode.cs
	Added Panel.cs
	Added TabPage.cs
	Added TabControl.cs
	Added Cursors.cs
	Added MessageBoxDefaultButton.cs
	Added MessageBoxIcon.cs
	Added MessageBoxOptions.cs
	Changes in MessageBoxButtons.cs (Added values)
	Changes in MessageBox (Completed all functions, added return values).
	"Finished" CheckBox.cs
	"Finished" ComboBox.cs
	"Finished" RadioButton
	"Finished" GroupBox
	"Finished" Panel
	Changes in Form to work with new RadioButton.
	Fix double Click reported on MenuItems.
	"Finished" Application

svn path=/trunk/mcs/; revision=22123
2004-01-15 17:19:30 +00:00

71 lines
1.3 KiB
C#

//
// System.Windows.Forms.Timer
//
// Authors:
// Alberto Fernández ([email protected])
// mirar.
// TODO: If it's active, it can't be garbage collected.
// TODO: If it's owned by a Container, it's freed when the container is freed.
using System.ComponentModel;
using System.Timers;
namespace System.Windows.Forms{
[MonoTODO]
public class Timer : Component {
private System.Timers.Timer t = new System.Timers.Timer();
public Timer (){
t.Elapsed += new ElapsedEventHandler (this.OnElapsed);
}
public Timer (IContainer container){
container.Add(this);
t.Elapsed += new ElapsedEventHandler (this.OnElapsed);
}
private void OnElapsed (object o, ElapsedEventArgs e){
OnTick (e);
}
public bool Enabled {
get{return t.Enabled;}
set{t.Enabled = value;}
}
public int Interval {
get {return (int) t.Interval;}
set {t.Interval = (float) value;}
}
public virtual void Start() {
t.Start();
}
public virtual void Stop() {
t.Stop();
}
public override string ToString(){
return "[" + GetType().FullName.ToString() + "], Interval: " + Interval;
}
public event EventHandler Tick;
protected virtual void OnTick(EventArgs e){
if ( Tick != null )
Tick ( this, e );
}
protected override void Dispose( bool disposing ) {
Enabled = false;
base.Dispose ( disposing );
}
}
}