//// /// Copyright (c) 2016 Saúl Piña . /// /// This file is part of xmlrpcwsc. /// /// xmlrpcwsc is free software: you can redistribute it and/or modify /// it under the terms of the GNU Lesser General Public License as published by /// the Free Software Foundation, either version 3 of the License, or /// (at your option) any later version. /// /// xmlrpcwsc is distributed in the hope that it will be useful, /// but WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /// GNU Lesser General Public License for more details. /// /// You should have received a copy of the GNU Lesser General Public License /// along with xmlrpcwsc. If not, see . //// using System; using System.Collections.Generic; namespace XmlRpc { /// /// XML-RPC Parameter helper /// public class XmlRpcParameter { /// /// Empty the struct. /// /// The struct public static Dictionary EmptyStruct() { return new Dictionary(); } /// /// Empty array /// /// The array public static List EmptyArray() { return new List(); } /// /// As array /// /// The array. /// List. public static List AsArray(params object[] list) { List listReturn = new List(); listReturn.AddRange(list); return listReturn; } /// /// As struct /// /// The struct /// List public static Dictionary AsStruct(params KeyValuePair[] list) { Dictionary dictReturn = new Dictionary(); foreach (KeyValuePair pair in list) { dictReturn.Add(pair.Key, pair.Value); } return dictReturn; } /// /// As member /// /// The member /// Key /// Value public static KeyValuePair AsMember(string key, object value) { KeyValuePair pairReturn = new KeyValuePair(key, value); return pairReturn; } } }