summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/IvyDomain.cs
blob: 754ed0e44648cb355a543cfc4f6e8899e7790b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace IvyBus
{
    public partial class IvyDomain : UserControl
    {
        public event EventHandler DomainChanged;
        [Category("Ivy")]
        public string Domain
        {
            get { return ivybus.Text; }
            set {
                ivybus.Text = value;
                if (DomainChanged != null ) DomainChanged(this, EventArgs.Empty);
            }
        }       

        public IvyDomain()
        {
            InitializeComponent();
        }


        private void ivybus_Validating(object sender, CancelEventArgs e)
        {
            e.Cancel = !Ivy.ValidatingDomain(ivybus.Text);
        }

        private void ivybus_Validated(object sender, EventArgs e)
        {
            Domain = ivybus.Text;
        }

        private void IvyDomain_Load(object sender, EventArgs e)
        {
            ivybus.Text = Ivy.getDomain(ivybus.Text);
        }

    }
}