summaryrefslogtreecommitdiff
path: root/IvyControl/IvyDomain.cs
diff options
context:
space:
mode:
authorfcolin2007-11-09 09:33:25 +0000
committerfcolin2007-11-09 09:33:25 +0000
commitb764700cdecea236cfaa4672034683b65717aef2 (patch)
treeca69f96fe3d06b39ea16ad813ff27feadf8843ad /IvyControl/IvyDomain.cs
parent664b2fb6da57253ebfe1d08036d7f27af4562553 (diff)
downloadivy-csharp-b764700cdecea236cfaa4672034683b65717aef2.zip
ivy-csharp-b764700cdecea236cfaa4672034683b65717aef2.tar.gz
ivy-csharp-b764700cdecea236cfaa4672034683b65717aef2.tar.bz2
ivy-csharp-b764700cdecea236cfaa4672034683b65717aef2.tar.xz
separation Control Windows Forms
Diffstat (limited to 'IvyControl/IvyDomain.cs')
-rw-r--r--IvyControl/IvyDomain.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/IvyControl/IvyDomain.cs b/IvyControl/IvyDomain.cs
new file mode 100644
index 0000000..7099db7
--- /dev/null
+++ b/IvyControl/IvyDomain.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Windows.Forms;
+
+namespace IvyBus
+{
+ public partial class IvyDomain : UserControl
+ {
+ private string domain = "";
+ public event EventHandler DomainChanged;
+#if (!PocketPC)
+ [Category("Ivy")]
+ [DefaultValue("")]
+ [Bindable(true)]
+#endif
+ public string Domain
+ {
+ get { return domain; }
+ set {
+ if (domain != value)
+ {
+ domain = value;
+ ivybus.Text = domain;
+ if (DomainChanged != null) DomainChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public IvyDomain()
+ {
+ InitializeComponent();
+ SetDefault();
+ }
+ public void SetDefault()
+ {
+ if (IsEmpty())
+ {
+ domain = Ivy.GetDomain(domain);
+ ivybus.Text = domain;
+ }
+ }
+ public bool IsEmpty()
+ {
+ return String.IsNullOrEmpty( domain );
+ }
+
+ private void ivybus_Validating(object sender, CancelEventArgs e)
+ {
+ e.Cancel = !Ivy.ValidatingDomain(ivybus.Text);
+ }
+
+ private void ivybus_Validated(object sender, EventArgs e)
+ {
+ if ( domain != ivybus.Text )
+ Domain = ivybus.Text;
+ }
+
+ }
+}