Esempio n. 1
0
        internal static McmpResponse ExecuteCommand(this Configuration.ClientConfiguration clientConfig, Uri cluster, Constants.Commands command, Dictionary <string, string> paramList = null)
        {
            string postData = clientConfig.GetPostData((string[])MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "RequiredKeys"), paramList);

            return(cluster.ExecuteCommand((string)MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "Method"),
                                          (string)MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "Path"), postData));
        }
Esempio n. 2
0
        internal static McmpResponse ExecuteCommand(this Configuration.ClientConfiguration clientConfig, Uri cluster, Constants.Commands command, params object[] paramList)
        {
            if (paramList.Length % 2 != 0)
            {
                throw new InvalidDataException("paramList must be an even number of parameters");
            }

            Dictionary <string, string> paramStringList = new Dictionary <string, string>();

            for (int idx = 0; idx < paramList.Length; idx += 2)
            {
                paramStringList.Add(paramList[idx].ToString(), paramList[idx + 1].ToString());
            }

            string postData = clientConfig.GetPostData((string[])MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "RequiredKeys"), paramStringList);

            return(cluster.ExecuteCommand((string)MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "Method"),
                                          (string)MCMP.Attributes.CommandAttribute.GetInfoFromCommand(command, "Path"), postData));
        }