public IntegratedParams SelectByPrefix(string prefix) { string newkey; int l; IntegratedParams rlt; if (string.IsNullOrEmpty(prefix)) { return(this); } rlt = new IntegratedParams(); l = prefix.Length; foreach (string key in Keys) { if (key.IndexOf(prefix) == 0) { newkey = key.Substring(l, key.Length - l); if (string.IsNullOrEmpty(newkey)) { newkey = Guid.NewGuid().ToString(); } rlt[newkey] = this[key]; } } return(rlt); }
protected static IntegratedParams ParseNamedParams(NameValueCollection Form) { IntegratedParams rlt = new IntegratedParams(); //List<object> pars = new List<object>(); //NameValueCollection Form = request.Form; RequestHelper.EnumKeys(Form, "par_", delegate(string key, string val) { rlt.Add(key, val); }); //rlt = new object[pars.Count]; //for (int i = 0; i < pars.Count; i++) //{ // rlt[i] = pars[i]; //} return(rlt); }