Пример #1
0
        /// <summary>
        ///     Gets the string value for the AARGTYPERampType 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 AARGTYPERampTypeEnum.Invalid or out of range.</returns>
        public static string ToStringAargtypeRampType(AargtypeRampTypeEnum value)
        {
            switch (value)
            {
            case AargtypeRampTypeEnum.SleepTimerRampType:
                return(CsAllowedValAargtypeRampTypeSleeptimerramptype);

            case AargtypeRampTypeEnum.AlarmRampType:
                return(CsAllowedValAargtypeRampTypeAlarmramptype);

            case AargtypeRampTypeEnum.AutoplayRampType:
                return(CsAllowedValAargtypeRampTypeAutoplayramptype);

            default:
                return(String.Empty);
            }
        }
Пример #2
0
        /// <summary>
        ///     Executes the RampToVolume action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        /// <param name="rampType">In value for the RampType action parameter.</param>
        /// <param name="desiredVolume">In value for the DesiredVolume action parameter. With range of 0 to 100. Increment of 1.</param>
        /// <param name="resetVolumeAfter">In value for the ResetVolumeAfter action parameter.</param>
        /// <param name="programUri">In value for the ProgramURI action parameter.</param>
        /// <returns>Out value for the RampTime action parameter.</returns>
        public async Task <ActionResult> RampToVolume(UInt32 instanceId, AargtypeChannelEnum channel,
                                                      AargtypeRampTypeEnum rampType, UInt16 desiredVolume, Boolean resetVolumeAfter, String programUri)
        {
            var loIn = new object[6];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            loIn[2] = RenderingControlExtensions.ToStringAargtypeRampType(rampType);
            loIn[3] = desiredVolume;
            loIn[4] = resetVolumeAfter;
            loIn[5] = programUri;
            var action = new SoapAction
            {
                ArgNames =
                    new[] { "InstanceID", "Channel", "RampType", "DesiredVolume", "ResetVolumeAfter", "ProgramURI" },
                Name = CsActionRampToVolume,
                ExpectedReplyCount = 1
            };
            SoapActionResult result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }