示例#1
0
文件: ExecHm.cs 项目: Centny/cswf
 public static void V_VNA(NetwRunnable nr, ExecHm rc, Bys m, out string name, out IDictionary<string, Object> args)
 {
     var res = new Dict(m.V<Dictionary<string, object>>());
     name = res.Val("name", "");
     var obj = res["args"];
     args = res["args"] as IDictionary<string,object>;
 }
示例#2
0
文件: LambdaEvnH.cs 项目: Centny/cswf
 public void onCon(NetwRunnable nr, Netw w)
 {
     if (this.OnCon != null)
     {
         this.OnCon(nr, w);
     }
 }
示例#3
0
文件: LambdaEvnH.cs 项目: Centny/cswf
 public void onErr(NetwRunnable nr, Exception e)
 {
     if (this.OnErr != null)
     {
         this.OnErr(nr, e);
     }
 }
示例#4
0
文件: LambdaEvnH.cs 项目: Centny/cswf
 public void begCon(NetwRunnable nr)
 {
     if (this.BegCon != null)
     {
         this.BegCon(nr);
     }
 }
示例#5
0
文件: LambdaEvnH.cs 项目: Centny/cswf
 public void endCon(NetwRunnable nr)
 {
     if (this.EndCon != null)
     {
         this.EndCon(nr);
     }
 }
示例#6
0
文件: QueueH.cs 项目: Centny/cswf
 public virtual void onCmd(NetwRunnable nr, Bys m)
 {
     foreach (CmdListener ml in this.qs)
     {
         ml.onCmd(nr, m);
     }
 }
示例#7
0
文件: ExecH.cs 项目: Centny/cswf
 public void onCmd(NetwRunnable nr, Bys m)
 {
     if (m.length < 3)
     {
         L.W("RC_S receive the command data less 3:" + m.toBs());
         return;
     }
     var pref = m.slice(0, 3);
     m.forward(3);
     this.H.onCmd(nr, m.newM(new PrefC(m, pref), m.bys, m.offset, m.length));
 }
示例#8
0
文件: ExecHm.cs 项目: Centny/cswf
 public void onCmd(NetwRunnable nr, Bys m)
 {
     try {
         string name;
         IDictionary<string, Object> args;
         this.vna(nr, this, m, out name, out args);
         var rc = new RCM_Cmd(m, name, args);
         bool next = false;
         foreach (var filter in this.filters)
         {
             if (!filter.Key.IsMatch(name))
             {
                 continue;
             }
             var res = filter.Value(rc, out next);
             if (next)
             {
                 continue;
             }
             else
             {
                 m.writev(res);
                 return;
             }
         }
         foreach (var handler in this.handler)
         {
             if (handler.Key.IsMatch(name))
             {
                 m.writev(handler.Value(rc));
                 return;
             }
         }
         m.writev(Util.dict("err", "function not found by name:" + name));
     }catch(Exception e)
     {
         L.E(e, "ExecHm exec error:{0}", e.Message);
         m.writev(Util.dict("err", "exec fail with " + e.Message));
     }
 }
示例#9
0
文件: TaskH.cs 项目: Centny/cswf
 public virtual void onCmd(NetwRunnable nr, Bys m)
 {
     new Task(i => h.onCmd(nr, m), 0).Start();
 }
示例#10
0
文件: TaskHTests.cs 项目: Centny/cswf
 public void onCmd(NetwRunnable nr, Bys m)
 {
     Console.WriteLine(val++);
     Thread.Sleep(300);
 }
示例#11
0
文件: DoNoneH.cs 项目: Centny/cswf
 public void onCmd(NetwRunnable nr, Bys m)
 {
 }
示例#12
0
文件: OBDHTests.cs 项目: Centny/cswf
 public void onCmd(NetwRunnable nr, Bys m)
 {
     Assert.AreEqual(this.val, m.get(0));
 }
示例#13
0
 public void onCmd(NetwRunnable nr, Bys m)
 {
     Assert.AreEqual(this.val, this.t.val);
     this.t.val++;
 }