コード例 #1
0
        /// <summary>
        /// Fall back to file persistence, in case of not available database
        /// </summary>
        private FilePersistence FallBackToPrimaryPersistence(PersistenceSecurity security)
        {
            Logging.Fatal("SQL Persistence layer failed to load. Fall back to File persistence");
            var newSecurity = new PersistenceSecurity(security);
            var persistence = new FilePersistence(newSecurity, this.favoriteIcons, this.connectionManager);

            this.settings.PersistenceSecurity = newSecurity;
            return(persistence);
        }
コード例 #2
0
 /// <summary>
 /// Fall back to file persistence, in case of not available database
 /// </summary>
 internal static void FallBackToPrimaryPersistence(PersistenceSecurity security)
 {
     PromptForFallback();
     var newSecurity = new PersistenceSecurity(security);
     var persistence = new FilePersistence(newSecurity);
     Settings.Instance.PersistenceSecurity = newSecurity;
     Nested.instance.persistence = persistence;
     persistence.Initialize();
 }
コード例 #3
0
        /// <summary>
        /// Fall back to file persistence, in case of not available database
        /// </summary>
        internal FilePersistence FallBackToPrimaryPersistence(PersistenceSecurity security)
        {
            Logging.Fatal("SQL Persistence layer failed to load. Fall back to File persistence");
            var newSecurity = new PersistenceSecurity(security);
            var persistence = new FilePersistence(newSecurity, favoriteIcons, connectionManager);

            settings.PersistenceSecurity = newSecurity;
            persistence.Initialize();
            return(persistence);
        }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
ファイル: FilePersistence.cs プロジェクト: wykpisz/Terminals
 /// <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);
 }
コード例 #6
0
ファイル: FilePersistence.cs プロジェクト: wykpisz/Terminals
 private void InitializeSecurity(PersistenceSecurity security)
 {
     this.Security = security;
     this.Security.AssignPersistence(this);
 }
コード例 #7
0
 internal Factory(PersistenceSecurity persistenceSecurity, Groups groups, DataDispatcher dispatcher)
 {
     this.groups = groups;
     this.dispatcher = dispatcher;
     this.persistenceSecurity = persistenceSecurity;
 }
コード例 #8
0
 /// <summary>
 /// Try to reuse current security in case of changing persistence, because user is already authenticated
 /// </summary>
 internal FilePersistence(PersistenceSecurity security)
     : this(security, new DataFileWatcher(Settings.Instance.FileLocations.Favorites))
 {
 }
コード例 #9
0
 private void InitializeSecurity(PersistenceSecurity security)
 {
     this.Security = security;
     this.Security.AssignPersistence(this);
 }
コード例 #10
0
 protected void UpdateFrom(CredentialBase source)
 {
     this.EncryptedUserName = source.EncryptedUserName;
     this.EncryptedDomain = source.EncryptedDomain;
     this.EncryptedPassword = source.EncryptedPassword;
     this.persistenceSecurity = source.persistenceSecurity;
 }
コード例 #11
0
 /// <summary>
 /// Creates new instance and initializes internal state from sourceSecurity.
 /// </summary>
 /// <param name="sourceSecurity">Not null current security instance to initialize from.</param>
 internal PersistenceSecurity(PersistenceSecurity sourceSecurity)
 {
     this.KeyMaterial = sourceSecurity.KeyMaterial;
 }
コード例 #12
0
 internal StoredCredentials(PersistenceSecurity persistenceSecurity)
 {
     this.persistenceSecurity = persistenceSecurity;
     this.cache = new List<ICredentialSet>();
     InitializeFileWatch();
 }
コード例 #13
0
 /// <summary>
 /// Creates new instance and initializes internal state from sourceSecurity.
 /// </summary>
 /// <param name="sourceSecurity">Not null current security instance to initialize from.</param>
 internal PersistenceSecurity(PersistenceSecurity sourceSecurity)
 {
     this.KeyMaterial = sourceSecurity.KeyMaterial;
 }
コード例 #14
0
 internal StoredCredentials(PersistenceSecurity persistenceSecurity)
 {
     this.persistenceSecurity = persistenceSecurity;
     this.cache = new List <ICredentialSet>();
     this.InitializeFileWatch();
 }
コード例 #15
0
ファイル: FilePersistence.cs プロジェクト: wykpisz/Terminals
 /// <summary>
 /// Try to reuse current security in case of changing persistence, because user is already authenticated
 /// </summary>
 internal FilePersistence(PersistenceSecurity security, FavoriteIcons favoriteIcons, ConnectionManager connectionManager)
     : this(security, new DataFileWatcher(Settings.Instance.FileLocations.Favorites),
            favoriteIcons, connectionManager)
 {
 }
コード例 #16
0
 public ToolTipBuilder(PersistenceSecurity persistenceSecurity)
 {
     this.persistenceSecurity = persistenceSecurity;
 }
コード例 #17
0
 internal void AssignStore(PersistenceSecurity persistenceSecurity)
 {
     this.TsGateway.Security.AssignStore(persistenceSecurity);
 }
コード例 #18
0
 internal void AssignStore(PersistenceSecurity persistenceSecurity)
 {
     this.persistenceSecurity = persistenceSecurity;
 }