public static void add_Message(Connection that, Action<MessageEvent> value)
        {
            if (!MessageFixup.ContainsKey(value))
                MessageFixup[value] = i => value(MessageEvent.CloneFrom(i));

            CommonExtensions.CombineDelegate(that, MessageFixup[value], MessageEvent.MESSAGE);
        }
 public static void remove_Message(Connection that, Action<MessageEvent> value)
 {
     if (MessageFixup.ContainsKey(value))
     {
         CommonExtensions.RemoveDelegate(that, MessageFixup[value], MessageEvent.MESSAGE);
         MessageFixup.Remove(value);
     }
 }
		public static void SendMessage(Connection c, SharedClass1.Messages m, params object[] e)
		{
			var i = new Message(((int)m).ToString());

			foreach (var z in e)
			{
				i.Add(z);
			}

			c.Send(i);
		}
		public static void remove_MessageDirect(Connection that, Action<object> value)
		{
			CommonExtensions.RemoveDelegate(that, value, MessageEvent.MESSAGE);
		}
 public static void remove_Init(Connection that, Action<object> value)
 {
     CommonExtensions.RemoveDelegate(that, value, ConnectionEvent.INIT);
 }
 public static void add_Init(Connection that, Action<object> value)
 {
     CommonExtensions.CombineDelegate(that, value, ConnectionEvent.INIT);
 }
 public static void remove_Disconnect(Connection that, Action<object> value)
 {
     CommonExtensions.RemoveDelegate(that, value, ConnectionEvent.DISCONNECT);
 }