Esempio n. 1
0
        /**
         * Convert GetAttributesRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertGetAttributes(GetAttributesRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "GetAttributes";
            if (request.IsSetDomainName())
            {
                parameters["DomainName"] = request.DomainName;
            }
            if (request.IsSetItemName())
            {
                parameters["ItemName"] = request.ItemName;
            }
            List <string> getAttributesRequestAttributeNameList      = request.AttributeName;
            int           getAttributesRequestAttributeNameListIndex = 1;

            foreach (string getAttributesRequestAttributeName in getAttributesRequestAttributeNameList)
            {
                parameters[String.Concat("AttributeName", ".", getAttributesRequestAttributeNameListIndex)] = getAttributesRequestAttributeName;
                getAttributesRequestAttributeNameListIndex++;
            }
            if (request.IsSetConsistentRead())
            {
                parameters["ConsistentRead"] = request.ConsistentRead.ToString().ToLower(CultureInfo.InvariantCulture);
            }

            return(parameters);
        }
Esempio n. 2
0
        private static IDictionary <string, string> ConvertGetAttributes(GetAttributesRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "GetAttributes";
            if (request.IsSetDomainName())
            {
                dictionary["DomainName"] = request.DomainName;
            }
            if (request.IsSetItemName())
            {
                dictionary["ItemName"] = request.ItemName;
            }
            List <string> attributeName = request.AttributeName;
            int           num           = 1;

            foreach (string str in attributeName)
            {
                dictionary["AttributeName" + "." + num] = str;
                num++;
            }
            if (request.IsSetConsistentRead())
            {
                dictionary["ConsistentRead"] = request.ConsistentRead.ToString().ToLower();
            }
            return(dictionary);
        }