/// <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();
        }
Example #2
0
 public IDirectoryStorage GetDirectoryStorage()
 {
     if (this.directoryStorage == null)
     {
         this.directoryStorage = new DirectoryStorage();
     }
     return(directoryStorage);
 }
Example #3
0
 public ProfileController(
     IApplicationManager applicationManager,
     IProfileService profileService,
     IDirectoryStorage directoryStorage)
 {
     _applicationManager = applicationManager;
     _profileService     = profileService;
     _directoryStorage   = directoryStorage;
 }
Example #4
0
 public ContactsController(IApplicationManager applicationManager, IContactService contactService, IDirectoryStorage directoryStorage)
 {
     _applicationManager = applicationManager;
     _contactService     = contactService;
     _directoryStorage   = directoryStorage;
 }
 protected DirectoryBackedStore()
 {
     tempStorage = new TempDirectoryStorage(GetType().Name);
 }