Exemplo n.º 1
0
 private void FinishRaise(Object sender, FinishEventArgs e)
 {
     if (e.Finish)
     {
         lock (Syncronization.SyncObj)
         {
             Console.SetCursorPosition(1, Console.WindowHeight);
             Console.ResetColor();
             Console.WriteLine("CONGRATULATION!!! You have finished level");
             Console.WriteLine("Press \"q\" to exit.");
         }
         this.UnregisterEvents();
         this._timer.Stop();
         for (;;)
         {
             ConsoleKeyInfo cki = Console.ReadKey();
             lock (Syncronization.SyncObj)
             {
                 Console.ResetColor();
                 Console.SetCursorPosition(0, Console.WindowHeight);
             }
             if (cki.Key == ConsoleKey.Q)
             {
                 lock (Syncronization.SyncObj)
                 {
                     Console.SetCursorPosition(1, Console.WindowHeight + 1);
                     Console.WriteLine();
                 }
                 Environment.Exit(0);
             }
         }
     }
 }
Exemplo n.º 2
0
 private void onFireFinish(FinishEventArgs args)
 {
     if (Finish != null)
     {
         Finish.Invoke(this, args);
     }
 }
Exemplo n.º 3
0
 void creator_Finished(object sender, FinishEventArgs e)
 {
     MessageBox.Show(e.Message, "Finish", MessageBoxButtons.OK, MessageBoxIcon.Information);
     button2.Invoke(new Action(() => button2.Enabled = false));
     progressBar.Value = 0;
     labelStatus.Text  = "Process not started";
 }
        public void Constructor(string placementId, ShowResult showResult)
        {
            var eventArgs = new FinishEventArgs(placementId, showResult);

            Assert.That(eventArgs.placementId, Is.EqualTo(placementId));
            Assert.That(eventArgs.showResult, Is.EqualTo(showResult));
        }
Exemplo n.º 5
0
        private void FinishRaise(bool finish)
        {
            FinishEventArgs e = new FinishEventArgs(finish);

            this.State = States.Stopped;
            this.OnFinish(e);
        }
Exemplo n.º 6
0
        public void Run()
        {
            Trace.WriteLine("Started git sync", "Gitsyncer");

            var xmlNodeList = Configuration.SelectNodes("//add");

            if (xmlNodeList != null)
            {
                foreach (XmlNode node in xmlNodeList)
                {
                    if (node.Attributes != null)
                    {
                        var url    = node.Attributes["url"].Value;
                        var folder = node.Attributes["folder"].Value;
                        var path   = Path.Combine(RootFolder, folder);

                        Trace.WriteLine(string.Format("Loading: {0} to {1}", url, path), "Gitsyncer");

                        Process(url, folder);
                    }
                }
            }

            var finishEventArgs = new FinishEventArgs();

            FireOnFinish(finishEventArgs);
        }
Exemplo n.º 7
0
        private void FinishedCreation(object sender, FinishEventArgs e)
        {
            MessageBox.Show("Group creation finished\nTotal time: " + e.TotalTime.Minutes.ToString() + ":" + e.TotalTime.Seconds.ToString()
                            , "Finished Group Creation", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.Invoke(new Action(() => DisableStatus()));
        }
 void creator_Finished(object sender, FinishEventArgs e)
 {
     MessageBox.Show(e.Message, "Finish", MessageBoxButtons.OK, MessageBoxIcon.Information);
     buttonStartAbort.Enabled = true;
     buttonStartAbort.Text    = "Start";
     progressBar.Value        = 0;
     labelStatus.Text         = "Process not started";
 }
        /// <summary>
        /// Whenever the github zip downloader completes and docs index is rebuilt
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ZipDownloader_OnFinish(object sender, FinishEventArgs e)
        {
            var indexer = ExamineManager.Instance.IndexProviderCollection[ExamineHelper.DocumentationIndexer];

            //TODO: Fix this - we cannot "Rebuild" on a live site, because the entire index will be taken down/deleted and then recreated, if people
            // are searching during this operation, YSODs will occur.
            indexer.RebuildIndex();
        }
Exemplo n.º 10
0
 protected virtual void FireOnFinish(FinishEventArgs e)
 {
     try
     {
         _e.FireCancelableEvent(OnFinish, this, e);
     }
     catch (Exception ex) { }
 }
Exemplo n.º 11
0
        /// <summary>
        /// Whenever the github zip downloader completes and docs index is rebuilt
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ZipDownloader_OnFinish(object sender, FinishEventArgs e)
        {
            var indexer = ExamineManager.Instance.IndexProviderCollection[ExamineHelper.DocumentationIndexer];

            //TODO: Fix this - we cannot "Rebuild" on a live site, because the entire index will be taken down/deleted and then recreated, if people
            // are searching during this operation, YSODs will occur.
            indexer.RebuildIndex();
        }
Exemplo n.º 12
0
 private void threadFinished(object sender, FinishEventArgs e)
 {
     this.Dispatcher.Invoke((Action)(() => {
         active.Remove((DecompilerThread)sender);
         sender = null;
         finished++;
         StartNextIfAble();
     }));
 }
Exemplo n.º 13
0
        private void <Platform> m__0(object sender, FinishEventArgs e)
        {
            EventHandler <FinishEventArgs> onFinish = this.OnFinish;

            if (onFinish != null)
            {
                onFinish(sender, new FinishEventArgs(e.placementId, e.showResult));
            }
        }
Exemplo n.º 14
0
        private void OnFinish(FinishEventArgs e)
        {
            EventHandler <FinishEventArgs> temp = Volatile.Read(ref this.EventFinish);

            if (temp != null)
            {
                temp(this, e);
            }
        }
Exemplo n.º 15
0
        public override void Finish(object sender, FinishEventArgs args)
        {
            // Set the whole sheet as table style
            string lastCellName = ColumnNumberToName(Model.Columns.Count()) + (args.Count + 1);

            FormatAsTable((Range)_WorkSheet.get_Range("A1", lastCellName));

            SaveExcel();
        }
Exemplo n.º 16
0
        public override void Finish(object sender, FinishEventArgs args)
        {
            if (FootTemplate != null)
            {
                string content = Razor.Parse(FootTemplate, GlobalModel.ToDynamicObject());
                _Writer.WriteLine(content);
            }

            _Writer.Close();
        }
Exemplo n.º 17
0
 protected virtual void FireOnFinish(FinishEventArgs e)
 {
     try
     {
         _events.FireCancelableEvent(OnFinish, this, e);
     }
     catch (Exception ex)
     {
         LogHelper.Error <ZipDownloader>("Error firing finish handler", ex);
     }
 }
Exemplo n.º 18
0
 void creator_Finished(object sender, FinishEventArgs e)
 {
     MessageBox.Show(e.Message, "Finish", MessageBoxButtons.OK, MessageBoxIcon.Information);
     if (!this.InvokeRequired)
     {
         this.EnableStart();
     }
     else
     {
         this.Invoke(new Action(() => {
             this.EnableStart();
         }));
     }
 }
Exemplo n.º 19
0
        private void FinishScaning(object sender, FinishEventArgs e)
        {
            gScanner.ScanProgressChanged -= new ProgressDelegate(ProgressChanged);
            MessageBox.Show("Scanning finished\nTotal time: " + e.TotalTime.Minutes.ToString() + ":" + e.TotalTime.Seconds.ToString()
                            + "\nTotal Files: " + e.TotalCount.ToString() + " \nStarting Artist-Album group creation..", "Finished Scanning", MessageBoxButtons.OK, MessageBoxIcon.Information);

            MediaGroupCreater creater = new MediaGroupCreater();

            creater.ProgressChanged  += new ProgressDelegate(ProgressChanged);
            creater.CreationFinished += new FinishHandler(FinishedCreation);

            Action action = new Action(() => creater.ReCreateArtistAlbumGroupCreation());

            action.DynamicInvoke();
        }
Exemplo n.º 20
0
        public void Run()
        {
            Trace.WriteLine("Started git sync", "Gitsyncer");

            foreach (XmlNode node in Configuration.SelectNodes("//add"))
            {
                var url    = node.Attributes["url"].Value;
                var folder = node.Attributes["folder"].Value;
                var path   = Path.Combine(RootFolder, folder);

                Trace.WriteLine("Loading: " + url + " to " + path, "Gitsyncer");

                process(url, folder);
            }

            FinishEventArgs ev = new FinishEventArgs();

            FireOnFinish(ev);
        }
Exemplo n.º 21
0
        public void ShowWithEvent(string placementId)
        {
            int             count     = 0;
            object          sender    = null;
            FinishEventArgs eventArgs = null;

            m_Platform.OnFinish += (s, a) =>
            {
                count++;
                sender    = s;
                eventArgs = a;
            };

            Assert.DoesNotThrow(() => m_Platform.Show(placementId));

            Assert.That(count, Is.EqualTo(1));
            Assert.That(sender, Is.SameAs(m_Platform));
            Assert.That(eventArgs, Is.Not.Null);
            Assert.That(eventArgs.placementId, Is.EqualTo(placementId));
            Assert.That(eventArgs.showResult, Is.EqualTo(ShowResult.Failed));
        }
        public void ConstructorTest()
        {
            FinishEventArgs e = new FinishEventArgs(false);

            Assert.IsFalse(e.Finish);
        }
Exemplo n.º 23
0
 protected virtual void FireOnFinish(FinishEventArgs e)
 {
     try
     {
         _e.FireCancelableEvent(OnFinish, this, e);
     }
     catch (Exception ex) { }
 }
Exemplo n.º 24
0
 private static void Visitor_Finish(object sender, FinishEventArgs e)
 {
     Console.WriteLine("It's finished");
 }
Exemplo n.º 25
0
		private void threadFinished(object sender, FinishEventArgs e) {
			this.Dispatcher.Invoke((Action)(() => {
				active.Remove((DecompilerThread)sender);
				sender = null;
				finished++;
				StartNextIfAble();
			}));
		}
Exemplo n.º 26
0
        public void Run()
        {
            Trace.WriteLine("Started git sync", "Gitsyncer");

            foreach (XmlNode node in Configuration.SelectNodes("//add"))
            {
                var url = node.Attributes["url"].Value;
                var folder = node.Attributes["folder"].Value;
                var path = Path.Combine(RootFolder, folder);

                Trace.WriteLine("Loading: " + url + " to " + path, "Gitsyncer");

                process(url, folder);
            }

            FinishEventArgs ev = new FinishEventArgs();
            FireOnFinish(ev);
        }
Exemplo n.º 27
0
 protected virtual void FireOnFinish(FinishEventArgs e)
 {
     try
     {
         _events.FireCancelableEvent(OnFinish, this, e);
     }
     catch (Exception ex)
     {
         LogHelper.Error<ZipDownloader>("Error firing finish handler", ex);
     }
 }
Exemplo n.º 28
0
        public void Run()
        {
            Trace.WriteLine("Started git sync", "Gitsyncer");

            var xmlNodeList = Configuration.SelectNodes("//add");
            if (xmlNodeList != null)
            {
                foreach (XmlNode node in xmlNodeList)
                {
                    if (node.Attributes != null)
                    {
                        var url = node.Attributes["url"].Value;
                        var folder = node.Attributes["folder"].Value;
                        var path = Path.Combine(RootFolder, folder);

                        Trace.WriteLine(string.Format("Loading: {0} to {1}", url, path), "Gitsyncer");

                        Process(url, folder);
                    }
                }
            }

            var finishEventArgs = new FinishEventArgs();
            FireOnFinish(finishEventArgs);
        }
Exemplo n.º 29
0
 void ZipDownloader_OnFinish(object sender, FinishEventArgs e)
 {
     var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection[ExamineHelper.DocumentationIndexer];
     indexer.RebuildIndex();
 }
Exemplo n.º 30
0
        void ZipDownloader_OnFinish(object sender, FinishEventArgs e)
        {
            var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection[ExamineHelper.DocumentationIndexer];

            indexer.RebuildIndex();
        }
Exemplo n.º 31
0
 public override void Finish(object sender, FinishEventArgs args)
 {
     // Make sure all Entities have been inserted.
     InsertAllTableEntity();
 }
Exemplo n.º 32
0
 private void OnUpdaterFinish(object sender, FinishEventArgs eventArgs)
 {
     UpdatePlaybackIndicators(0);
 }
Exemplo n.º 33
0
 protected virtual void OnInit(FinishEventArgs fes)
 {
     Console.WriteLine($"{fes.SpiderInfo}初始化完毕");
     FinishEvent?.Invoke(this, fes);
 }