public MainStationDevice(MainStation _MainStation, string _Name, ProductDataBase.Device _Device, ushort _ID)
 {
     mainstation = _MainStation;
     Name = _Name;
     device = _Device;
     ID = _ID;
 }
 public Event(MainStationDevice _Device, ProductDataBase.Device.Event _Event)
 {
     device = _Device;
     eventtype = _Event;
     Name = DefaultName;
 }
 public MainStationDevice RegisterDevice(string _Name, ProductDataBase.Device _Device, ushort _DeviceID)
 {
     MainStationDevice d = new MainStationDevice(this, _Name, _Device, _DeviceID);
     foreach (ProductDataBase.Device.Event e in _Device.events)
     {
         d.Events.Add(e.ID, new MainStationDevice.Event(d, e));
     }
     devices.Add(d);
     return d;
 }