Beispiel #1
0
 /// <summary>
 /// Removes the listener.
 /// </summary>
 /// <param name="eventCode">The event code.</param>
 /// <param name="socketListener">The socket listener.</param>
 public void RemoveListener(EventCode eventCode, IGSocketListener socketListener)
 {
     if (mSocketDictionary.TryGetValue(eventCode, out var eventHandler))
     {
         eventHandler.RemoveListener(socketListener);
     }
 }
Beispiel #2
0
            /// <summary>
            /// Removes the listener.
            /// </summary>
            /// <param name="socketListener">The socket listener.</param>
            public void RemoveListener(IGSocketListener socketListener)
            {
                bool isSuccess = _listenerList.Remove(socketListener);

                if (!isSuccess)
                {
                    Console.WriteLine("移除IGSocketListener失敗");
                }
            }
Beispiel #3
0
 /// <summary>
 /// Adds the listener.
 /// </summary>
 /// <param name="eventCode">The event code.</param>
 /// <param name="socketListener">The socket listener.</param>
 public void AddListener(EventCode eventCode, IGSocketListener socketListener)
 {
     if (mSocketDictionary.TryGetValue(eventCode, out var eventHandler))
     {
         eventHandler.AddListener(socketListener);
     }
     else
     {
         Console.WriteLine("於GSocket中並未定義該Event:" + eventCode);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Adds the listener.
 /// </summary>
 /// <param name="socketListener">The socket listener.</param>
 public void AddListener(IGSocketListener socketListener)
 {
     _listenerList.Add(socketListener);
 }