Esempio n. 1
0
        private void ComparsionWriterObserver(AsyncTextWriterBase.TEvent aEvent, AsyncTextWriterBase aObject)
        {
            if (InvokeRequired)
            {
                SymbianUtils.AsyncTextWriterBase.Observer observer = new SymbianUtils.AsyncTextWriterBase.Observer(ComparsionWriterObserver);
                this.BeginInvoke(observer, new object[] { aEvent, aObject });
            }
            else
            {
                switch (aEvent)
                {
                case SymbianUtils.AsyncTextWriterBase.TEvent.EWritingStarted:
                    this.Text        = "Creating Excel File...";
                    iProgBar.Maximum = 100; //%
                    iProgBar.Minimum = 0;   //%
                    iProgBar.Value   = 0;
                    break;

                case SymbianUtils.AsyncTextWriterBase.TEvent.EWritingProgress:
                    iProgBar.Value = aObject.Progress;
                    break;

                case SymbianUtils.AsyncTextWriterBase.TEvent.EWritingComplete:
                    iProgBar.Value = 100;
                    Close();
                    break;
                }
            }
        }
 private void WriterObserver(AsyncTextWriterBase.TEvent aEvent, AsyncTextWriterBase aObject)
 {
     if (aEvent == AsyncTextWriterBase.TEvent.EWritingComplete)
     {
         SetCompletionState(aObject, KWriterIsComplete);
         CheckForCompletion();
     }
     else if (aEvent == AsyncTextWriterBase.TEvent.EWritingStarted)
     {
         SetCompletionState(aObject, KWriterIsIncomplete);
     }
     else
     {
         NotifyEvent(TEvent.EEventProgress);
     }
 }