summaryrefslogtreecommitdiff
path: root/IvyControl/IvyDomain.cs
diff options
context:
space:
mode:
authorfcolin2007-11-09 10:20:21 +0000
committerfcolin2007-11-09 10:20:21 +0000
commit3a1a7b17f7765edf56d2714c337c8501adcf2189 (patch)
tree6e56713f4b5983e89c2280ca37ad6c2e3015c4d4 /IvyControl/IvyDomain.cs
parentbd1c7b7348b8e5532040b178a891f5295e46d35b (diff)
downloadivy-csharp-3a1a7b17f7765edf56d2714c337c8501adcf2189.zip
ivy-csharp-3a1a7b17f7765edf56d2714c337c8501adcf2189.tar.gz
ivy-csharp-3a1a7b17f7765edf56d2714c337c8501adcf2189.tar.bz2
ivy-csharp-3a1a7b17f7765edf56d2714c337c8501adcf2189.tar.xz
separation des references a Windows Form
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;
+ }
+
+ }
+}