Пример #1
0
 private void OnPartnershipStateChanged(object sender, PartnershipStateChangeEventArgs args)
 {
     this.OnPropertyChanged("CanDoSync");
     this.OnPropertyChanged("CanCancelSync");
     this.OnPropertyChanged("CanCancelSync");
     this.OnPropertyChanged("CanCancelSync");
     CommandManager.InvalidateRequerySuggested();
 }
Пример #2
0
 private void OnPartnershipStateChanged(object sender, PartnershipStateChangeEventArgs e)
 {
     if (this.Panel != null)
     {
         ISyncPartnership partnership = sender as ISyncPartnership;
         if (partnership == this.controller.CurrentSyncPartnership)
         {
             //this.Panel.Dispatcher.BeginInvoke(DispatcherPriority.Normal, delegate {
             //    this.ResetModelState();
             //});
             if ((e.NewState == PartnershipState.Idle) && ((e.OldState == PartnershipState.CancelingSync) || (e.OldState == PartnershipState.Syncing)))
             {
                 this.controller.CurrentDevice.ReloadZmdbIfChanged(false);
             }
         }
     }
 }
Пример #3
0
        private void OnPartnershipStateChanged(object sender, PartnershipStateChangeEventArgs e)
        {
            string progressHeaderForSync;
            ISyncPartnership partnership = sender as ISyncPartnership;
            if (partnership != this.controller.CurrentSyncPartnership)
            {
                return;
            }
            switch (e.NewState)
            {
                case PartnershipState.PreparingSync:
                    progressHeaderForSync = string.Empty;
                    switch (partnership.SyncStartType)
                    {
                        case SyncStartType.AutoSync:
                        case SyncStartType.ManualSync:
                            progressHeaderForSync = Resources.ProgressHeaderForSync;
                            break;

                        case SyncStartType.Delete:
                            progressHeaderForSync = Resources.ProgressHeaderForDelete;
                            break;

                        case SyncStartType.CopyToPC:
                            progressHeaderForSync = Resources.ProgressHeaderForCopyToPC;
                            break;

                        case SyncStartType.SendRingtones:
                            progressHeaderForSync = Resources.ProgressHeaderForRingtones;
                            break;
                    }
                    break;

                case PartnershipState.CancelingSync:
                    this.UpdateProgressBar(Resources.CancellingSyncText, string.Empty, string.Empty, 100f, 100f, true);
                    goto Label_00CB;

                case PartnershipState.Idle:
                    this.IsProgressLocked = false;
                    goto Label_00CB;

                default:
                    goto Label_00CB;
            }
            this.UpdateProgressBar(progressHeaderForSync, string.Empty, string.Empty, 0f, 100f, false);
            Label_00CB:
            this.ResetModelState();
        }