void TransitionToUploadingState() {
   Debug.Assert(this.modelState == ModelState.SignedIn);
   this.lkgStatePersistor.SaveLKGState(this);
   this.ComputeEmailContactCounts();
   this.contactIterator =
       new ContactIterator(
           this.flatStoreModelList);
   this.mailIterator =
       new MailIterator(
           this.flatFolderModelList,
           new VoidDelegate(this.IncrementFailedMailCount));
   this.useCurrent = false;
   this.pauseTime = GoogleEmailUploaderConfig.MinimumPauseTime;
   this.modelState = ModelState.Uploading;
 }
 /// <summary>
 /// Cleans up the model for disposing
 /// </summary>
 public void Dispose() {
   try {
     GoogleEmailUploaderTrace.EnteringMethod(
         "GoogleEmailUploaderModel.Dispose");
     if (this.modelState == ModelState.Initialized) {
       this.gaiaAuthenticator = null;
     } else if (this.modelState == ModelState.SignedIn) {
       this.emailId = null;
       this.password = null;
       this.lkgStatePersistor.SaveLKGState(this);
       this.lkgStatePersistor = null;
       this.flatStoreModelList = null;
       this.flatFolderModelList = null;
       this.DisposeClientModels();
     } else if (this.modelState == ModelState.Uploading ||
         this.modelState == ModelState.UploadingPause) {
       this.emailId = null;
       this.password = null;
       this.lkgStatePersistor = null;
       this.flatStoreModelList = null;
       this.flatFolderModelList = null;
       this.mailUploader = null;
       this.contactIterator.Dispose();
       this.mailIterator.Dispose();
       this.contactIterator = null;
       this.mailIterator = null;
       if (this.pauseTimer != null) {
         this.pauseTimer.Dispose();
         this.pauseTimer = null;
       }
       this.DisposeClientModels();
     }
   } finally {
     GoogleEmailUploaderTrace.ExitingMethod(
         "GoogleEmailUploaderModel.Dispose");
   }
 }
 void TransitionToInitializedState() {
   this.gaiaAuthenticator =
       new GoogleAuthenticator(this.HttpFactory,
                               AccountType.GoogleOrHosted,
                               this.ApplicationName);
   this.emailId = null;
   this.password = null;
   this.lkgStatePersistor = null;
   this.flatStoreModelList = null;
   this.flatFolderModelList = null;
   this.mailUploader = null;
   this.contactIterator = null;
   this.mailIterator = null;
   this.pauseTimer = null;
   this.modelState = ModelState.Initialized;
 }