예제 #1
0
        protected IEnumerable <XElement> getElementList(PLCommands _command, string _elementsKey)
        {
            string   commandUrl  = this.makeUrl(_command);
            XElement elementRoot = Utils.elementFromURL(commandUrl);

            var elements =
                from el in elementRoot.Elements(_elementsKey)
                select el;

            return(elements);
        }
예제 #2
0
        protected string makeUrl(PLCommands _command, Dictionary <string, string> _params)
        {
            string paramSeparator = "?";
            string commandUrl     = String.Format("{0}{1}", this.baseUrl, PLCommandBaseUrl[_command]);

            if (_params != null)
            {
                foreach (KeyValuePair <string, string> param in _params)
                {
                    commandUrl    += String.Format("{0}{1}={2}", paramSeparator, param.Key, param.Value);
                    paramSeparator = "&";
                }
            }
            return(commandUrl);
        }
예제 #3
0
 protected string makeUrl(PLCommands _command)
 {
     return(this.makeUrl(_command, null));
 }