public static ContactSyncProfile GetDefaultSyncProfile()
 {
     var syncProfile = new ContactSyncProfile()
     {
         SyncSettings = ContactSyncSettings.GetDefault(),
         OutlookSettings =
         {
             OutlookOptions = OutlookOptionsEnum.OutlookDesktop |
                                 OutlookOptionsEnum.DefaultProfile |
                              OutlookOptionsEnum.DefaultMailBoxCalendar
         },
         SyncDirection = SyncDirectionEnum.OutlookGoogleOneWay,
         SyncFrequency = new IntervalSyncFrequency { Hours = 1, Minutes = 0, StartTime = DateTime.Now }
     };
     syncProfile.SetSourceDestTypes();
     return syncProfile;
 }
        public static ContactSyncProfile GetDefaultSyncProfile()
        {
            var syncProfile = new ContactSyncProfile
            {
                SyncSettings    = ContactSyncSettings.GetDefault(),
                OutlookSettings =
                {
                    OutlookOptions = OutlookOptionsEnum.OutlookDesktop |
                                     OutlookOptionsEnum.DefaultProfile |
                                     OutlookOptionsEnum.DefaultMailBoxCalendar
                },
                SyncDirection = SyncDirectionEnum.OutlookGoogleOneWay,
                SyncFrequency = new IntervalSyncFrequency {
                    Hours = 1, Minutes = 0, StartTime = DateTime.Now
                }
            };

            syncProfile.SetSourceDestTypes();
            return(syncProfile);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// </summary>
 /// <returns>
 /// </returns>
 public static Settings GetDefaultSettings()
 {
     var settings = new Settings
     {
         IsFirstSave = true,
         SettingsVersion = ApplicationInfo.Version,
         AppSettings = AppSettings.GetDefault(),
         CalendarSyncProfiles = new ObservableCollection<CalendarSyncProfile>
         {
             CalendarSyncProfile.GetDefaultSyncProfile()
         },
         TaskSyncProfiles = new ObservableCollection<TaskSyncProfile>
         {
             TaskSyncProfile.GetDefaultSyncProfile()
         },
         ContactSyncProfiles = new ObservableCollection<ContactSyncProfile>
         {
             ContactSyncProfile.GetDefaultSyncProfile()
         },
         GoogleAccounts = new ObservableCollection<GoogleAccount>()
     };
     return settings;
 }
 public bool GetDestEntriesToAdd(ContactSyncProfile syncProfile, ContactsWrapper sourceList, ContactsWrapper destinationList)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
        public string SyncNow(ContactSyncProfile syncProfile, SyncMetric syncMetric, SyncCallback syncCallback)
        {
            try
            {
                if (syncProfile.GoogleSettings.GoogleAccount == null || 
                    syncProfile.GoogleSettings.GoogleCalendar == null ||
                    !syncProfile.ValidateOutlookSettings())
                {
                    MessageService.ShowMessageAsync(
                        "Please configure Google and Outlook calendar in settings to continue.");
                    return "Invalid Settings";
                }
                ResetSyncData();

                var isSyncComplete = ContactUpdateService.SyncContact(syncProfile, syncMetric, syncCallback);
                return isSyncComplete ? null : "Error Occurred";
            }
            catch (AggregateException exception)
            {
                var flattenException = exception.Flatten();
                MessageService.ShowMessageAsync(flattenException.Message);
                Logger.Error(exception);
                return flattenException.Message;
            }
            catch (Exception exception)
            {
                MessageService.ShowMessageAsync(exception.Message);
                Logger.Error(exception);
                return exception.Message;
            }
        }