コード例 #1
0
ファイル: AddAction.cs プロジェクト: willwhitehead94/SCIPA
        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);
            }
        }
コード例 #2
0
ファイル: AddAction.cs プロジェクト: willwhitehead94/SCIPA
        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();
            }
        }