/// <summary> /// SanteDB configuration /// </summary> public ConfigurationManager(IConfigurationPersister defaultPersister = null) { var persister = defaultPersister ?? ApplicationContext.Current.ConfigurationPersister; try { this.Configuration = persister.Load(); } catch (ConfigurationException e) { Trace.TraceError("Could not load configuration file"); if (persister.HasBackup()) { Trace.TraceInformation("Will attempt to restore persisted backup"); persister.Restore(); this.Configuration = persister.Load(); } else { Trace.TraceInformation("No backup could be found, attempting to correct configuration issues"); e.Configuration.Sections.RemoveAll(o => o is XmlNode[]); persister.Save(e.Configuration); this.Configuration = e.Configuration; Trace.TraceInformation("No backup could be found, attempting to correct configuration issues"); } } }
/// <summary> /// Initializes a new instance of the <see cref="SanteDB.DisconnectedClient.ApplicationContext"/> class. /// </summary> public ApplicationContext(IConfigurationPersister configPersister) { this.m_serviceManager = new DependencyServiceManager(); this.m_configManager = new ConfigurationManager(configPersister); this.ConfigurationPersister = configPersister; this.m_serviceManager.AddServiceProvider(configPersister); this.m_serviceManager.AddServiceProvider(this.m_configManager); }
public MainWindowViewModel(IFeedDownloader feedDownloader, IConfigurationPersister configurationPersister) { this.feedDownloader = feedDownloader; this.configurationPersister = configurationPersister; feeds = new ObservableCollection <Feed>(); Feeds = new ReadOnlyObservableCollection <Feed>(feeds); DownloadCommand = new RelayCommand((param) => Download(param as FeedItem), (param) => !(param as FeedItem)?.Downloading ?? false); Configuration = configurationPersister.Load(); foreach (var feed in Configuration.Feeds) { feeds.Add(feed); } }
/// <summary> /// Initializes the presistent <see cref="Configuration"/> builder /// with an specific <see cref="IConfigurationPersister"/> /// </summary> public PersistentConfigurationBuilder(IConfigurationPersister configurationPersister) { this.configurationPersister = configurationPersister; }
public NHibInstaller(IConfigurationPersister persister) { _persister = persister; }
public PersistingInstaller(IConfigurationPersister persister) { _persister = persister; }
public LocalStorageConfigurationProvider(IConfigurationPersister persister, IContentProcessor contentProcessor) { m_Persister = persister; m_ContentProcessor = contentProcessor; }
public NHibernateInstaller(IConfigurationPersister persister) { m_persister = persister; }