Esempio n. 1
0
 /// <summary>
 /// On the specified name and callback.
 /// </summary>
 /// <param name="name">Name.</param>
 /// <param name="callback">Callback.</param>
 public void On(string name, SergIOCallback callback)
 {
     if (callbacks == null)
     {
         callbacks = new Dictionary <string, SergIOCallbackData>();
     }
     if (callbacks.ContainsKey(name))
     {
         callbacks[name].Callback += callback;
     }
     else
     {
         SergIOCallbackData d = new SergIOCallbackData();
         d.Callback += callback;
         callbacks.Add(name, d);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// On the specified name and callback.
 /// </summary>
 /// <param name="name">Name.</param>
 /// <param name="callback">Callback.</param>
 public void On(string name, SergIOCallback callback) => server.On(name, callback);
Esempio n. 3
0
 /// <summary>
 /// On the specified name and callback.
 /// </summary>
 /// <param name="name">Name.</param>
 /// <param name="callback">Callback.</param>
 public void On(string name, SergIOCallback callback) => client.On(name, callback);