예제 #1
0
    public void OnDestroy()
    {
        if (OnFocus != null)
        {
            foreach (Delegate d in OnFocus.GetInvocationList())
            {
                OnFocus -= (Action <IDialog>)d;
            }
            OnFocus = null;
        }

        if (OnBlur != null)
        {
            foreach (Delegate d in OnBlur.GetInvocationList())
            {
                OnBlur -= (Action <IDialog>)d;
            }
            OnBlur = null;
        }

        if (OnShow != null)
        {
            foreach (Delegate d in OnShow.GetInvocationList())
            {
                OnShow -= (Action <IDialog>)d;
            }
            OnShow = null;
        }

        if (OnHide != null)
        {
            foreach (Delegate d in OnHide.GetInvocationList())
            {
                OnHide -= (Action <IDialog>)d;
            }
            OnHide = null;
        }

        if (OnClose != null)
        {
            foreach (Delegate d in OnClose.GetInvocationList())
            {
                OnClose -= (Action <IDialog>)d;
            }
            OnClose = null;
        }

        if (OnCancel != null)
        {
            foreach (Delegate d in OnCancel.GetInvocationList())
            {
                OnCancel -= (Action <IDialog>)d;
            }
            OnCancel = null;
        }
    }
예제 #2
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (OnClose != null)
     {
         foreach (var d in OnClose.GetInvocationList())
         {
             OnClose -= (Action <object, DialogResult>)d;
         }
     }
 }
예제 #3
0
        //private void CheckBoxClick(object sender, RoutedEventArgs e)
        //{
        //    if (cbTwoSided.IsChecked != null) Program.GameSettings.UseTwoSidedTable = cbTwoSided.IsChecked.Value;
        //}

        #region Implementation of IDisposable

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            Player.OnLocalPlayerWelcomed -= PlayerOnOnLocalPlayerWelcomed;
            if (OnClose != null)
            {
                foreach (var d in OnClose.GetInvocationList())
                {
                    OnClose -= (Action <object>)d;
                }
            }
        }
예제 #4
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (OnClose != null)
     {
         foreach (var d in OnClose.GetInvocationList())
         {
             OnClose -= (Action <object, DialogResult>)d;
         }
     }
     Program.LobbyClient.OnLoginComplete -= LobbyClientOnLoginComplete;
     Program.LobbyClient.OnDisconnect    -= LobbyClientOnDisconnect;
 }
예제 #5
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (OnClose != null)
     {
         foreach (var d in OnClose.GetInvocationList())
         {
             OnClose -= (Action <object, DialogResult>)d;
         }
     }
     Program.LobbyClient.Connected    -= LobbyClient_Connected;
     Program.LobbyClient.Disconnected -= LobbyClient_Disconnected;
 }
예제 #6
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (OnClose != null)
     {
         foreach (var d in OnClose.GetInvocationList())
         {
             OnClose -= (Action <object, DialogResult>)d;
         }
     }
     if (PropertyChanged != null)
     {
         foreach (var d in PropertyChanged.GetInvocationList())
         {
             PropertyChanged -= (PropertyChangedEventHandler)d;
         }
     }
 }
예제 #7
0
        private void invokeOnClose(WebSocketCloseStatus closeStatus, string statusDescription)
        {
            if (OnClose == null)
            {
                return;
            }

            try
            {
                var members = OnClose.GetInvocationList().Cast <Func <WebSocketCloseStatus, string, Task> >();

                Task.WhenAll(members.Select(x => x(closeStatus, statusDescription)))
                .ContinueWith(t => InvokeOnError(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
                //.Wait(0);
            }
            catch (Exception ex) when(ex.InnerException is TaskCanceledException)
            {
            }
        }