コード例 #1
0
 public XElement ExecuteRequest (NameValueCollection arguments)
 {
     var doc = new XDocument (
           new XElement ("Arguments", 
                       arguments.OfType<string> ().Select (key =>
                 new XElement ("Argument",
                           new XElement ("Key", key),
                           new XElement ("Value", arguments [key])))
             .OfType<object> ().ToArray ()));
     return doc.Root;
 }
コード例 #2
0
 public XElement ExecuteRequest (NameValueCollection arguments)
 {
     var doc = new XDocument (
           new XElement ("Arguments", 
                       arguments.OfType<string> ().Select (key =>
                 new XElement ("Argument",
                           new XElement ("Key", key),
                           new XElement ("Value", arguments [key])))
             .OfType<object> ().ToArray ()));
     _captureResult (doc.Root);
     XNamespace ns = "http://sdb.amazonaws.com/doc/2009-04-15/";
     return new XElement(ns + "SelectResponse", new XElement(ns + "SelectResult", new XElement[]
         {
             new XElement(ns + "Item", new XElement[]{
                 new XElement(ns + "Name", "ItemName1"),
                 new XElement(ns + "Attribute", new XElement[] {
                     new XElement(ns + "Name", "Count"),
                     new XElement(ns + "Value", 1)
                 })
             })
         }));
 }
コード例 #3
0
ファイル: Curl.cs プロジェクト: wolfweb/Ww
 public String PostAsForm(String url, NameValueCollection form, Boolean useSignature = false) {
     var args = form.OfType<String>().Select(k => new KeyValuePair<String, String>(k, form.Get(k)));
     return Post(url, FormSerializer.Serialize(args), FormType, useSignature);
 }
コード例 #4
0
ファイル: Helper.cs プロジェクト: amartelr/Beetle.js
        /// <summary>
        /// Gets the beetle parameters.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <returns></returns>
        public static List<KeyValuePair<string, string>> GetBeetleParameters(NameValueCollection parameters) {
            if (parameters == null) return null;

            return parameters
                .OfType<string>()
                .Where(k => !string.IsNullOrWhiteSpace(k) && k.StartsWith("!e"))
                .Select(k => {
                    var v = parameters[k];
                    var i = v.IndexOf(':');
                    var exp = v.Substring(0, i);
                    var args = v.Substring(i + 1);
                    return new KeyValuePair<string, string>(exp, args);
                })
                .ToList();
        }