Exemplo n.º 1
0
        /// <summary>
        /// Removes the switch from the actuator. The swtich is removed from the
        /// actuators settings file and the file saved.
        /// </summary>
        /// <param name="actuator"></param>
        /// <param name="switchName"></param>
        /// <returns></returns>
        public bool UnregisterSwitch(IActuator actuator, String switchName)
        {
            if (_actuators.Find(actuator.GetType()) == null)
            {
                return(false);
            }

            return(_actuators.RemoveSwitch(actuator, switchName));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the specified switch to the list of switches supported
        /// by the actuator. switchSetting contains all the attributes of the
        /// switch.  The swtich is added to the actuators settings file and the
        /// file saved.
        /// </summary>
        /// <param name="actuator">Actuator to add to</param>
        /// <param name="switchSetting">Settings for the switch</param>
        /// <returns>true on success, false if actuator not found</returns>
        public bool RegisterSwitch(IActuator actuator, SwitchSetting switchSetting)
        {
            if (_actuators.Find(actuator.GetType()) == null)
            {
                return(false);
            }

            return(_actuators.AddSwitch(actuator, switchSetting));
        }