Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Initialize Data
            ISeedStore seedStore = null;

            if (Properties.Settings.Default.UseDatabaseStore)
            {
                if (!TestConnection(Properties.Settings.Default.SeedStoreConnectionString))
                {
                    MessageBox.Show($"Failed to connect to database.  Using in-memory cache instead.  Seed results won't be saved if you close the program: \n\n{Properties.Settings.Default.SeedStoreConnectionString}", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    seedStore = new SeedMemoryStore();
                }
                else
                {
                    seedStore = new SeedDatabaseStore(Properties.Settings.Default.SeedStoreConnectionString);
                }
            }
            else
            {
                seedStore = new SeedMemoryStore();
            }

            var seedManager = new SeedManager(seedStore);

            Application.Run(new RustCrossbreederForm(seedManager));
        }
Beispiel #2
0
 /// <summary>
 /// Creates an instance of TokenGenerator with the private key and a store for t.
 /// </summary>
 /// <param name="seedStore">The storage for t.</param>
 public TokenVerifier(ISeedStore seedStore)
 {
     _seedStore = seedStore;
 }
Beispiel #3
0
 /// <summary>
 /// Create a new seed manager
 /// </summary>
 public SeedManager(ISeedStore seedStore)
 {
     this._seedStore = seedStore;
 }
 public AnonymousTokenValidationService(IAnonymousTokenKeySource anonymousTokenKeySource, ISeedStore seedStore)
 {
     _anonymousTokenKeySource = anonymousTokenKeySource;
     _tokenVerifier           = new TokenVerifier(seedStore);
 }