public SetOptions ( CalDavSynchronizer.Contracts.Options options, |
||
options | CalDavSynchronizer.Contracts.Options | |
generalOptions | ||
리턴 | System.Threading.Tasks.Task |
public ComponentContainer (Application application) { try { XmlConfigurator.Configure(); _itemChangeWatcher = new OutlookItemChangeWatcher (application.Inspectors); _itemChangeWatcher.ItemSavedOrDeleted += ItemChangeWatcherItemSavedOrDeleted; _session = application.Session; s_logger.Info ("Startup..."); EnsureSynchronizationContext(); _applicationDataDirectory = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "CalDavSynchronizer"); _optionsDataAccess = new OptionsDataAccess ( Path.Combine ( _applicationDataDirectory, GetOrCreateConfigFileName (_applicationDataDirectory, _session.CurrentProfileName) )); var synchronizerFactory = new SynchronizerFactory ( GetProfileDataDirectory, new TotalProgressFactory ( new ProgressFormFactory(), int.Parse (ConfigurationManager.AppSettings["loadOperationThresholdForProgressDisplay"]), ExceptionHandler.Instance), _session, TimeSpan.Parse (ConfigurationManager.AppSettings["calDavConnectTimeout"]), TimeSpan.Parse (ConfigurationManager.AppSettings["calDavReadWriteTimeout"])); _scheduler = new Scheduler (synchronizerFactory, EnsureSynchronizationContext); _scheduler.SetOptions (_optionsDataAccess.LoadOptions()); _updateChecker = new UpdateChecker (new AvailableVersionService(), () => _optionsDataAccess.IgnoreUpdatesTilVersion); _updateChecker.NewerVersionFound += UpdateChecker_NewerVersionFound; _updateChecker.IsEnabled = _optionsDataAccess.ShouldCheckForNewerVersions; } catch (Exception x) { ExceptionHandler.Instance.LogException (x, s_logger); throw; } s_logger.Info ("Startup finnished"); }
private void InitializeSynchronizer() { try { XmlConfigurator.Configure(); Session = Application.Session; s_logger.Info ("Startup..."); EnsureSynchronizationContext(); var applicationDataDirectory = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "CalDavSynchronizer"); OptionsDataAccess = new OptionsDataAccess ( Path.Combine ( applicationDataDirectory, GetOrCreateConfigFileName (applicationDataDirectory, Session.CurrentProfileName) )); var synchronizerFactory = new SynchronizerFactory ( applicationDataDirectory, new TotalProgressFactory ( new Ui.ProgressFormFactory(), int.Parse (ConfigurationManager.AppSettings["loadOperationThresholdForProgressDisplay"]), ExceptionHandler.Instance), Application.Session); Scheduler = new Scheduler (synchronizerFactory); Scheduler.SetOptions (OptionsDataAccess.LoadOptions()); } catch (Exception x) { ExceptionHandler.Instance.LogException (x, s_logger); throw; } s_logger.Info ("Startup finnished"); }