コード例 #1
0
 public DeviceEventConfig(DeviceEventSettings settings)
 {
     EventName = settings.EventName;
     EventType = settings.EventType.Value;
     UseForFeedIn = settings.UseForFeedIn;
 }
コード例 #2
0
        public void DeleteEvent(DeviceEventSettings e)
        {
            DeviceEventSettings forDeletion = null;

            foreach (DeviceEventSettings settings in deviceEvents)
            {
                if (settings == e)
                {
                    forDeletion = settings;
                    break;
                }
            }

            if (forDeletion != null)
                deviceEvents.Remove(forDeletion);

            XmlElement devices = GetElement("deviceevents");
            if (devices == null || e == null)
                return;

            devices.RemoveChild(e.settings);
            SettingChangedEventHandler("");

            DoPropertyChanged("DeviceEvents");
        }
コード例 #3
0
        public void RegisterEvents()
        {
            XmlElement events = GetElement("deviceevents");
            if (events == null)
                events = AddElement(settings, "deviceevents");

            deviceEvents = new ObservableCollection<DeviceEventSettings>();

            foreach (XmlElement e in events.ChildNodes)
            {
                if (e.Name == "event")
                {
                    DeviceEventSettings eventSettings = new DeviceEventSettings(ApplicationSettings, e, this);
                    deviceEvents.Add(eventSettings);
                }
            }
        }
コード例 #4
0
        public DeviceEventSettings AddEvent()
        {
            XmlElement events = GetElement("deviceevents");
            XmlElement e = AddElement(events, "event");

            DeviceEventSettings newEvent = new DeviceEventSettings(ApplicationSettings, e, this);
            deviceEvents.Add(newEvent);

            DoPropertyChanged("DeviceEvents");
            return newEvent;
        }