ForceClose() публичный Метод

public ForceClose ( ) : void
Результат void
Пример #1
0
        private void HandleClose(bool hideOnly)
        {
            TimeSpan elapsed = DateTime.Now - _lastShowTime;

            if (elapsed >= DelayInterval)
            {
                // if the dialog has been shown for more than 500ms, just close it
                if (_currentWindow != null && _currentWindow.IsVisible)
                {
                    if (hideOnly)
                    {
                        _currentWindow.Hide();
                    }
                    else
                    {
                        _currentWindow.ForceClose();
                    }
                }
            }
            else
            {
                CloseTimer.Tag = hideOnly;
                // otherwise, set a timer so that we close it after it has been shown for 500ms
                CloseTimer.Interval = DelayInterval - elapsed;
                CloseTimer.Start();
            }
        }
Пример #2
0
 public bool Close()
 {
     if (IsOpen)
     {
         _currentWindow.ForceClose();
         _currentWindow = null;
         return(true);
     }
     else
     {
         return(false);
     }
 }