internal ConnectionHistory(Favorites favorites)
 {
     this.favorites = favorites;
     fileWatcher = new DataFileWatcher(FileLocations.HistoryFullFileName);
     fileWatcher.FileChanged += new EventHandler(this.OnFileChanged);
     fileWatcher.StartObservation();
     ThreadPool.QueueUserWorkItem(new WaitCallback(LoadHistory));
 }
 /// <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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public SerializationContextBuilder(Groups groups, Favorites favorites, DataDispatcher dispatcher)
 {
     this.groups     = groups;
     this.favorites  = favorites;
     this.dispatcher = dispatcher;
 }