Пример #1
0
        public static void ShowAlert(string message, string title = "消息")
        {
            if (null != _instnace)
            {
                _instnace._flag = true;
                _instnace.Close();
            }

            _instnace = new AlertWindow();
            _instnace.Title = _instnace.TitleRun.Text = title;
            _instnace.MessageRun.Text = message;
            _instnace.Owner = MainWindow.Instance;
            _instnace.Show();

            MainWindow.Instance.Focus();
            MainWindow.Instance.MainTextBox.Focus();
        }
Пример #2
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            _instnace.Dispose();
            _instnace = null;

            MainWindow.Instance.Focus();
            MainWindow.Instance.MainTextBox.Focus();
        }