/// <summary> /// Prepares the necessary modules for the store to function. /// If shouldReload, the modules will be loaded again even if they are already initialized. /// </summary> protected void InitModules(bool shouldReload) { if (!shouldReload && database != null && storage != null) { return; } if (database != null) { database.Dispose(); } // Load database and storage. database = CreateDatabase(); storage = CreateStorage(); if (database == null) { throw new NullReferenceException("DirectoryBackedStore.LoadModules - Database is null!"); } if (storage == null) { throw new NullReferenceException("DirectoryBackedStore.LoadModules - Storage is null!"); } // Initialize the database. database.Initialize(); }
public IDirectoryStorage GetDirectoryStorage() { if (this.directoryStorage == null) { this.directoryStorage = new DirectoryStorage(); } return(directoryStorage); }
public ProfileController( IApplicationManager applicationManager, IProfileService profileService, IDirectoryStorage directoryStorage) { _applicationManager = applicationManager; _profileService = profileService; _directoryStorage = directoryStorage; }
public ContactsController(IApplicationManager applicationManager, IContactService contactService, IDirectoryStorage directoryStorage) { _applicationManager = applicationManager; _contactService = contactService; _directoryStorage = directoryStorage; }
protected DirectoryBackedStore() { tempStorage = new TempDirectoryStorage(GetType().Name); }