diff options
-rw-r--r-- | CSharp/Ivy/IvyPPC/IvyDomain.cs | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyDomain.cs b/CSharp/Ivy/IvyPPC/IvyDomain.cs index 55e45bf..754ed0e 100644 --- a/CSharp/Ivy/IvyPPC/IvyDomain.cs +++ b/CSharp/Ivy/IvyPPC/IvyDomain.cs @@ -10,18 +10,15 @@ namespace IvyBus {
public partial class IvyDomain : UserControl
{
- private Ivy bus;
-
- public Ivy Bus
- {
- get { return bus; }
- set { bus = value; }
- }
+ public event EventHandler DomainChanged;
[Category("Ivy")]
public string Domain
{
get { return ivybus.Text; }
- set { ivybus.Text = value; }
+ set {
+ ivybus.Text = value;
+ if (DomainChanged != null ) DomainChanged(this, EventArgs.Empty);
+ }
}
public IvyDomain()
@@ -32,25 +29,17 @@ namespace IvyBus private void ivybus_Validating(object sender, CancelEventArgs e)
{
- e.Cancel = false;
+ e.Cancel = !Ivy.ValidatingDomain(ivybus.Text);
}
private void ivybus_Validated(object sender, EventArgs e)
{
- if (bus != null)
- {
- bus.stop();
- bus.start(ivybus.Text);
- }
+ Domain = ivybus.Text;
}
private void IvyDomain_Load(object sender, EventArgs e)
{
ivybus.Text = Ivy.getDomain(ivybus.Text);
- if (bus != null)
- {
- bus.start(ivybus.Text);
- }
}
}
|