コード例 #1
0
        /// <summary>
        ///     Gets the string value for the LEDState state var from its enumeration value.
        /// </summary>
        /// <param name="value">The enumeration value to get the string value for.</param>
        /// <returns>The string value for the enumeration, or string.empty if LEDStateEnum.Invalid or out of range.</returns>
        public static string ToStringLedState(LedStateEnum value)
        {
            switch (value)
            {
            case LedStateEnum.On:
                return(CsAllowedValLedStateOn);

            case LedStateEnum.Off:
                return(CsAllowedValLedStateOff);

            default:
                return(String.Empty);
            }
        }
コード例 #2
0
        /// <summary>
        ///     Executes the SetLEDState action.
        /// </summary>
        /// <param name="desiredLedState">In value for the DesiredLEDState action parameter.</param>
        public async Task SetLedState(LedStateEnum desiredLedState)
        {
            var loIn = new object[1];

            loIn[0] = DeviceProperties.ToStringLedState(desiredLedState);
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredLEDState" },
                Name               = CsActionSetLedState,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }