Example #1
0
        /// <summary>
        ///     Gets the string value for the AARGTYPEUpdateType 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 AARGTYPEUpdateTypeEnum.Invalid or out of range.</returns>
        public static string ToStringAargtypeUpdateType(AargtypeUpdateTypeEnum value)
        {
            switch (value)
            {
            case AargtypeUpdateTypeEnum.All:
                return(CsAllowedValAargtypeUpdateTypeAll);

            case AargtypeUpdateTypeEnum.Software:
                return(CsAllowedValAargtypeUpdateTypeSoftware);

            default:
                return(String.Empty);
            }
        }
        /// <summary>
        ///     Executes the CheckForUpdate action.
        /// </summary>
        /// <param name="updateType">In value for the UpdateType action parameter.</param>
        /// <param name="cachedOnly">In value for the CachedOnly action parameter.</param>
        /// <param name="version">In value for the Version action parameter.</param>
        /// <returns>Out value for the UpdateItem action parameter.</returns>
        public async Task <ActionResult> CheckForUpdate(AargtypeUpdateTypeEnum updateType, Boolean cachedOnly,
                                                        String version)
        {
            var loIn = new object[3];

            loIn[0] = ZoneGroupTopologyExtensions.ToStringAargtypeUpdateType(updateType);
            loIn[1] = cachedOnly;
            loIn[2] = version;
            var action = new SoapAction
            {
                ArgNames           = new[] { "UpdateType", "CachedOnly", "Version" },
                Name               = CsActionCheckForUpdate,
                ExpectedReplyCount = 1
            };
            SoapActionResult result = await InvokeActionAsync(action, loIn);

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