Beispiel #1
0
        public AddAction(Models.Rule rule)
        {
            //Initialise
            InitializeComponent();
            _rule = rule;

            //If Action already created, load the info.
            _action = rule.Action;

            //If Communicator already created, load the info.
            if (_action != null)
            {
                var controller = new CommunicatorController();
                _comm = controller.GetAllCommunicators().FirstOrDefault(c => c.Id == rule.Action.CommunicatorId);
            }
        }
Beispiel #2
0
        private void bCommunicator_Click(object sender, EventArgs e)
        {
            if (_comm == null)
            {
                var devCont = new DeviceController();
                var device = devCont.RetrieveDevice(_rule.DeviceId);

                var ai = new AddCommunicator(device,false);
                ai.ShowDialog();
                _comm = ai._communicator;
            }
            else
            {
                var cm = new CommunicatorModifier(_comm);
                cm.ShowDialog();
            }
        }