コード例 #1
0
        public void ClearEventInvocationList()
        {
            if (ErrorOccured != null)
            {
                foreach (var subscribedDelegate in ErrorOccured.GetInvocationList())
                {
                    ErrorOccured -= (EventHandler <BaseErrorResponseInfo>)subscribedDelegate;
                }
            }

            if (LoadingStarted != null)
            {
                foreach (var subscribedDelegate in LoadingStarted.GetInvocationList())
                {
                    LoadingStarted -= (EventHandler <EventArgs>)subscribedDelegate;
                }
            }

            if (LoadingCompleted != null)
            {
                foreach (var subscribedDelegate in LoadingCompleted.GetInvocationList())
                {
                    LoadingCompleted -= (EventHandler <EventArgs>)subscribedDelegate;
                }
            }
        }
コード例 #2
0
 protected void UnsubscribeEvents()
 {
     if (ErrorOccured != null)
     {
         foreach (var delegateMethod in ErrorOccured.GetInvocationList())
         {
             ErrorOccured -= (delegateMethod as ErrorEventHandler);
         }
     }
 }
コード例 #3
0
ファイル: Chat.cs プロジェクト: Arcidev/Card-Game
        public void UnsubscribeAllHandlers()
        {
            if (ErrorOccured != null)
            {
                foreach (var handler in ErrorOccured.GetInvocationList())
                {
                    ErrorOccured -= handler as Action <ChatType, string, string>;
                }
            }

            if (MessageReceived != null)
            {
                foreach (var handler in MessageReceived.GetInvocationList())
                {
                    MessageReceived -= handler as Action <ChatType, string, string>;
                }
            }
        }