Beispiel #1
0
 public static void Dispose()
 {
     if (toast != null)
     {
         try
         {
             toast.Close();
         }
         catch { }
     }
     toast = null;
 }
Beispiel #2
0
 public static void Show(string says)
 {
     Toast.says = says;
     Log.AddLog("ui", "显示了一条吐司:" + Toast.says);
     App.Current.Dispatcher.Invoke((Action) delegate
     {
         toast = new Toast();
         toastList.TrimToSize();
         toast.Owner = Application.Current.MainWindow;
         toast.WindowStartupLocation = WindowStartupLocation.CenterOwner;
         toast.Show();
     });
     Thread.Sleep(2000);
     if (!MainWindow.readyExit)
     {
         App.Current.Dispatcher.Invoke((Action) delegate
         {
             toast.Close();
         });
     }
 }