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 { domain = value; ivybus.Text = domain; if (DomainChanged != null ) DomainChanged(this, EventArgs.Empty); } } public IvyDomain() { InitializeComponent(); } public void SetDefault() { if (IsEmpty()) { domain = Ivy.getDomain(domain); ivybus.Text = domain; } } public bool IsEmpty() { return 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; } } }