コード例 #1
0
 public static void ShowWindow(TimeSpan initialDelay, CancellationToken token, ProgressSource progressSource)
 {
     AnimatedGifWindow wnd     = null;
     Thread            thread1 = new Thread(delegate {
         if (!token.IsCancellationRequested)
         {
             EventHandler <int> < > 9__5;
             Action < > 9__4;
             Action <Task> < > 9__2;
             try
             {
                 Task.Delay(initialDelay, token).ContinueWith <bool>(t => true).Wait();
             }
             catch (Exception)
             {
                 return;
             }
             wnd = new AnimatedGifWindow();
             wnd.Show();
             Action <Task> continuationAction = < > 9__2;
             if (< > 9__2 == null)
             {
                 Action <Task> local3 = < > 9__2;
                 continuationAction   = < > 9__2 = delegate(Task t) {
                     if (!t.IsCanceled)
                     {
                         Action < > 9__3;
                         Action method = < > 9__3;
                         if (< > 9__3 == null)
                         {
                             Action local1 = < > 9__3;
                             method        = < > 9__3 = () => wnd.Topmost = false;
                         }
                         wnd.Dispatcher.BeginInvoke(method, new object[0]);
                     }
                 };
             }
             Task.Delay(TimeSpan.FromSeconds(5.0), token).ContinueWith(continuationAction);
             Action callback = < > 9__4;
             if (< > 9__4 == null)
             {
                 Action local4 = < > 9__4;
                 callback      = < > 9__4 = () => wnd.Dispatcher.BeginInvoke(new Action(wnd.Close), new object[0]);
             }
             token.Register(callback);
             EventHandler <int> handler3 = < > 9__5;
             if (< > 9__5 == null)
             {
                 EventHandler <int> local5 = < > 9__5;
                 handler3 = < > 9__5 = (sender, p) => wnd.Dispatcher.BeginInvoke(() => wnd.get_TaskbarItemInfo().set_ProgressValue(((double)p) / 100.0), new object[0]);
             }
             EventHandler <int> handler = handler3;
             progressSource.Progress   += handler;
             try
             {
                 new Application().Run(wnd);
             }
             finally
             {
                 progressSource.Progress -= handler;
             }
         }
     });