Example #1
0
        private static FilePersistence CreateFilePersistence(IDataFileWatcher fileWatcher, ConnectionManager connectionManager)
        {
            FilePersistence persistence = CreateNotInitializedFilePersistence(fileWatcher, connectionManager);

            persistence.Initialize();
            return(persistence);
        }
 /// <summary>
 /// For testing purpose allowes to inject internaly used services
 /// </summary>
 internal FilePersistence(PersistenceSecurity security, IDataFileWatcher fileWatcher)
 {
     this.InitializeSecurity(security);
     this.Dispatcher = new DataDispatcher();
     this.storedCredentials = new StoredCredentials(security);
     this.groups = new Groups(this);
     this.favorites = new Favorites(this);
     this.connectionHistory = new ConnectionHistory(this.favorites);
     this.factory = new Factory(security, this.groups, this.Dispatcher);
     this.InitializeFileWatch(fileWatcher);
 }
Example #3
0
 /// <summary>
 /// For testing purpose allowes to inject internaly used services
 /// </summary>
 internal FilePersistence(PersistenceSecurity security, IDataFileWatcher fileWatcher,
                          FavoriteIcons favoriteIcons, ConnectionManager connectionManager)
 {
     this.fileLocations = Settings.Instance.FileLocations;
     this.serializer    = new FavoritesFileSerializer(connectionManager);
     this.InitializeSecurity(security);
     this.Dispatcher        = new DataDispatcher();
     this.storedCredentials = new StoredCredentials(security);
     this.groups            = new Groups(this);
     this.favorites         = new Favorites(this, favoriteIcons, connectionManager);
     this.connectionHistory = new ConnectionHistory(this.favorites);
     this.factory           = new Factory(this.groups, this.Dispatcher, connectionManager);
     this.contextBuilder    = new SerializationContextBuilder(this.groups, this.favorites, this.Dispatcher);
     this.InitializeFileWatch(fileWatcher);
 }
Example #4
0
 private void InitializeFileWatch(IDataFileWatcher fileWatcher)
 {
     this.fileWatcher              = fileWatcher;
     this.fileWatcher.FileChanged += new EventHandler(this.FavoritesFileChanged);
     this.fileWatcher.StartObservation();
 }
 private void InitializeFileWatch(IDataFileWatcher fileWatcher)
 {
     this.fileWatcher = fileWatcher;
     this.fileWatcher.FileChanged += new EventHandler(this.FavoritesFileChanged);
     this.fileWatcher.StartObservation();
 }
Example #6
0
 private void InitializeFileWatch(IDataFileWatcher fileWatcher)
 {
     this.fileWatcher              = fileWatcher;
     this.fileWatcher.FileChanged += this.FavoritesFileChanged;
     this.fileWatcher.StartObservation();
 }
Example #7
0
 /// <summary>
 ///     Real filewatch works, only, if the path is correctly configured.
 ///     Changing the path after the watch is created, doesnt raise any event.
 /// </summary>
 private void ConfigFilePathChanged(object sender, FileChangedEventArgs e)
 {
     this.fileWatcher              = this.initializeFileWatcher(e.NewPath);
     this.fileWatcher.FileChanged += this.ConfigFileChanged;
 }
Example #8
0
 internal Settings(IDataFileWatcher fileWatcher)
     : this(p => fileWatcher)
 {
 }
Example #9
0
        internal static FilePersistence CreateNotInitializedFilePersistence(IDataFileWatcher fileWatcher, ConnectionManager connectionManager)
        {
            var icons = TestConnectionManager.CreateTestFavoriteIcons();

            return(new FilePersistence(new PersistenceSecurity(), fileWatcher, icons, connectionManager));
        }
Example #10
0
 internal static FilePersistence CreateFilePersistence(IDataFileWatcher fileWatcher)
 {
     return(CreateFilePersistence(fileWatcher, TestConnectionManager.Instance));
 }
 private void AssignNewFileWatch(IDataFileWatcher newWatcher)
 {
     fileWatcher = newWatcher;
     fileWatcher.FileChanged += new EventHandler(ConfigFileChanged);
 }