Exemplo n.º 1
0
        private void ComparisonEngineObserver(AsyncReaderBase.TEvent aEvent, AsyncReaderBase aSender)
        {
            if (InvokeRequired)
            {
                SymbianUtils.AsyncReaderBase.Observer observer = new SymbianUtils.AsyncReaderBase.Observer(ComparisonEngineObserver);
                this.BeginInvoke(observer, new object[] { aEvent, aSender });
            }
            else
            {
                switch (aEvent)
                {
                case SymbianUtils.AsyncReaderBase.TEvent.EReadingStarted:
                    this.Text        = "Comparing Heaps...";
                    iProgBar.Maximum = 100; //%
                    iProgBar.Minimum = 0;   //%
                    iProgBar.Value   = 0;
                    break;

                case SymbianUtils.AsyncReaderBase.TEvent.EReadingProgress:
                    iProgBar.Value = aSender.Progress;
                    break;

                case SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete:
                    iProgBar.Value = 100;
                    iComparisonWriter.SaveAsExcel();
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void Parser_Observer(SymbianUtils.AsyncReaderBase.TEvent aEvent, AsyncReaderBase aSender)
        {
            if (InvokeRequired)
            {
                SymbianUtils.AsyncReaderBase.Observer observer = new SymbianUtils.AsyncReaderBase.Observer(Parser_Observer);
                this.BeginInvoke(observer, new object[] { aEvent, aSender });
            }
            else
            {
                switch (aEvent)
                {
                case SymbianUtils.AsyncReaderBase.TEvent.EReadingStarted:
                    iProgressBar.Maximum = 100;                           //%
                    iProgressBar.Minimum = 0;                             //%
                    iProgressBar.Value   = 0;
                    break;

                case SymbianUtils.AsyncReaderBase.TEvent.EReadingProgress:
                    iProgressBar.Value = iParser.Progress;
                    break;

                case SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete:
                    Close();
                    break;
                }
            }
        }