public static DecodeUri ( string uri, string &scheme ) : string>.IDictionary |
||
uri | string | |
scheme | string | |
Результат | string>.IDictionary |
public static ReplyState LookupReplyStateByUri(object ctx, string uri) { ReqrepManager rrm = _instance_table[ctx]; string scheme; IDictionary <string, string> kvpairs = SenderFactory.DecodeUri(uri, out scheme); int id = Int32.Parse(kvpairs["id"]); ReplyState rs; if (rrm._reply_id_table.TryGet(id, out rs)) { return(rs); } else { throw new Exception(String.Format("Invalid id: {0}", id)); } }
public static ISender CreateInstance(object ctx, string uri) { string scheme; var kv = SenderFactory.DecodeUri(uri, out scheme); if (scheme.Equals("frag")) { int max = System.Int32.Parse(kv["max"]); string wuri = kv["wrap"]; ISender wrapped = SenderFactory.CreateInstance(ctx, wuri); return(new FragmentingSender(max, wrapped)); } else { throw new System.Exception("Unrecognized scheme: " + scheme); } }