Exemple #1
0
 public Application(
     MarketMakerService marketMakerService,
     ILog logger,
     MarginTradingSettings marginSettings,
     IMaintenanceModeService maintenanceModeService,
     IRabbitMqService rabbitMqService,
     MatchingEngineRoutesManager matchingEngineRoutesManager,
     IMigrationService migrationService,
     IConvertService convertService,
     IFxRateCacheService fxRateCacheService,
     IExternalOrderbookService externalOrderbookService,
     BrokerSettingsChangedHandler brokerSettingsChangedHandler)
 {
     _marketMakerService           = marketMakerService;
     _logger                       = logger;
     _marginSettings               = marginSettings;
     _maintenanceModeService       = maintenanceModeService;
     _rabbitMqService              = rabbitMqService;
     _matchingEngineRoutesManager  = matchingEngineRoutesManager;
     _migrationService             = migrationService;
     _convertService               = convertService;
     _fxRateCacheService           = fxRateCacheService;
     _externalOrderbookService     = externalOrderbookService;
     _brokerSettingsChangedHandler = brokerSettingsChangedHandler;
 }
Exemple #2
0
 public Application(
     IRabbitMqNotifyService rabbitMqNotifyService,
     IConsole consoleWriter,
     MarketMakerService marketMakerService,
     ILog logger,
     MarginSettings marginSettings,
     IMaintenanceModeService maintenanceModeService,
     IRabbitMqService rabbitMqService,
     MatchingEngineRoutesManager matchingEngineRoutesManager,
     IMigrationService migrationService,
     IConvertService convertService,
     ExternalOrderBooksList externalOrderBooksList)
 {
     _rabbitMqNotifyService = rabbitMqNotifyService;
     _consoleWriter         = consoleWriter;
     _marketMakerService    = marketMakerService;
     _logger                      = logger;
     _marginSettings              = marginSettings;
     _maintenanceModeService      = maintenanceModeService;
     _rabbitMqService             = rabbitMqService;
     _matchingEngineRoutesManager = matchingEngineRoutesManager;
     _migrationService            = migrationService;
     _convertService              = convertService;
     _externalOrderBooksList      = externalOrderBooksList;
 }
Exemple #3
0
        void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorkerArgs args             = (BackgroundWorkerArgs)e.Argument;
            IMigrationService    migrationService = (IMigrationService)MigrationServiceManager.GetService(typeof(IMigrationService));

            switch (args.Task)
            {
            case BackgroundWorkerTask.Start:
                migrationService.StartSessionGroup(args.SessionGroupUniqueId);
                e.Result = args;
                break;

            case BackgroundWorkerTask.Resume:
                migrationService.ResumeSessionGroup(args.SessionGroupUniqueId);
                break;

            case BackgroundWorkerTask.Stop:
                migrationService.StopSessionGroup(args.SessionGroupUniqueId);
                break;

            case BackgroundWorkerTask.Pause:
                migrationService.PauseSessionGroup(args.SessionGroupUniqueId);
                break;
            }
        }
Exemple #4
0
 public AuthController(IAuthService authService, IMigrationService migrationService, IConfiguration configuration, IDataStore dataStore)
 {
     _authService = authService;
     _migService  = migrationService;
     _config      = configuration;
     _dataStore   = dataStore;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheService" /> class.
        /// </summary>
        /// <param name="service">Provides access to core services.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service" /> is null.
        /// </exception>
        public CacheService(IMigrationService service)
        {
            service.AssertNotNull(nameof(service));

            protector    = new MachineKeyDataProtector(new[] { typeof(CacheService).FullName });
            this.service = service;
        }
Exemple #6
0
 public OnAreaEnter(
     IMigrationService migration,
     IPlayerService player)
 {
     _migration = migration;
     _player    = player;
 }
Exemple #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphClient"/> class.
        /// </summary>
        /// <param name="service">Provides access to core application services.</param>
        /// <param name="client">Provides the ability to interact with the Microsoft Graph.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service"/> is null.
        /// or
        /// <paramref name="client"/> is null.
        /// </exception>
        public GraphClient(IMigrationService service, IGraphServiceClient client)
        {
            service.AssertNotNull(nameof(service));
            client.AssertNotNull(nameof(client));

            this.service = service;
            this.client  = client;
        }
 /// <summary>
 /// initialise une nouvelle instance la classe
 /// </summary>
 public DatabaseService(IMigrationService migrationService)
 {
     _databasePath = DependencyService.Get <IPlatFormService>().GetLocalFilePath("database.db");
     using (var connection = Connnection())
     {
         migrationService.Migrate(connection);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthenticationProvider"/> class.
        /// </summary>
        /// <param name="service">Provides access to core services.</param>
        /// <param name="customerId">Identifier for customer whose resources are being accessed.</param>
        /// <exception cref="System.ArgumentException">
        /// <paramref name="customerId"/> is empty or null.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="service"/> is null.
        /// </exception>
        public AuthenticationProvider(IMigrationService service, string customerId)
        {
            service.AssertNotNull(nameof(service));
            customerId.AssertNotEmpty(nameof(customerId));

            this.customerId = customerId;
            this.service    = service;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MigrationManager"/> class.
        /// </summary>
        /// <param name="service">Provides access to core services.</param>
        /// <param name="scriptManager">Provides the ability to invoke scripts.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service"/> is null
        /// or
        /// <paramref name="scriptManager"/> is null.
        /// </exception>
        public MigrationManager(IMigrationService service, IScriptManager scriptManager)
        {
            scriptManager.AssertNotNull(nameof(scriptManager));
            service.AssertNotNull(nameof(service));

            this.scriptManager = scriptManager;
            this.service       = service;
        }
Exemple #11
0
        void m_refreshBW_DoWork(object sender, DoWorkEventArgs e)
        {
            IMigrationService migrationService      = (IMigrationService)MigrationServiceManager.GetService(typeof(IMigrationService));
            SessionGroupInitializationStatus status = SessionGroupInitializationStatus.Unknown;

            if (DataModel != null && DataModel.Configuration != null)
            {
                status = migrationService.GetSessionGroupInitializationStatus(DataModel.Configuration.SessionGroupUniqueId);
            }
            switch (status)
            {
            case SessionGroupInitializationStatus.Initialized:
                if (migrationService.GetRunningSessionGroups().Contains(DataModel.Configuration.SessionGroupUniqueId))
                {
                    ISyncStateManager stateManager     = SqlSyncStateManager.GetInstance();
                    PipelineState     newPipelineState = stateManager.GetCurrentState(OwnerType.SessionGroup, DataModel.Configuration.SessionGroupUniqueId);
                    if (s_canTransitionFrom[(int)m_currentPipelineState, (int)newPipelineState])
                    {
                        e.Result = newPipelineState;
                    }
                    else
                    {
                        Console.WriteLine("Cannot transition from " + m_currentPipelineState + " to " + newPipelineState);
                    }
                    IsCompleted = false;
                }
                else
                {
                    e.Result = PipelineState.Default;
                    using (Microsoft.TeamFoundation.Migration.EntityModel.RuntimeEntityModel context = Microsoft.TeamFoundation.Migration.EntityModel.RuntimeEntityModel.CreateInstance())
                    {
                        var query = from sg in context.RTSessionGroupSet
                                    where sg.GroupUniqueId.Equals(DataModel.Configuration.SessionGroupUniqueId)
                                    select sg.State;
                        int?state = query.FirstOrDefault();
                        if (state != null && (Microsoft.TeamFoundation.Migration.BusinessModel.BusinessModelManager.SessionStateEnum)state == BusinessModelManager.SessionStateEnum.Completed && ConflictManager != null && ConflictManager.TotalConflicts == 0)
                        {
                            IsCompleted = true;
                        }
                        else
                        {
                            IsCompleted = false;
                        }
                    }
                }
                break;

            case SessionGroupInitializationStatus.Initializing:
                IsCompleted = false;
                break;

            case SessionGroupInitializationStatus.NotInitialized:
            case SessionGroupInitializationStatus.Unknown:
                e.Result    = PipelineState.Default;
                IsCompleted = false;
                break;
            }
        }
Exemple #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphClient"/> class.
        /// </summary>
        /// <param name="service">Provides access to core application services.</param>
        /// <param name="customerId">Identifier for customer whose resources are being accessed.</param>
        /// <exception cref="ArgumentException">
        /// <paramref name="customerId"/> is empty or null.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service"/> is null.
        /// </exception>
        public GraphClient(IMigrationService service, string customerId)
        {
            service.AssertNotNull(nameof(service));
            customerId.AssertNotEmpty(nameof(customerId));

            this.customerId = customerId;
            this.service    = service;
            client          = new GraphServiceClient(new AuthenticationProvider(this.service, customerId));
        }
 public OnAreaEnter(
     IMigrationService migration,
     IPlayerService player,
     IMapService map)
 {
     _migration = migration;
     _player    = player;
     _map       = map;
 }
 public static void MigrateTo(IMigrationService migrationService, string connectionString, 
     string migrationDefinitionResourceName, int? targetVersion)
 {
     WithResource(migrationDefinitionResourceName,
         delegate(Stream stream)
         {
             migrationService.Migrate(connectionString, targetVersion, new StreamReader(stream, Encoding.UTF8));
         });
 }
Exemple #15
0
 public StartPageViewModel()
 {
     _migrationService  = SimpleIoc.Default.GetInstance <IMigrationService>();
     _database          = SimpleIoc.Default.GetInstance <SQLiteConnection>();
     _navigationService = SimpleIoc.Default.GetInstance <INavigationService>();
     _client            = SimpleIoc.Default.GetInstance <IWallabagClient>();
     _device            = SimpleIoc.Default.GetInstance <IPlatformSpecific>();
     _logging           = SimpleIoc.Default.GetInstance <ILoggingService>();
 }
Exemple #16
0
 public MongoMigration(IMigrationLocator migrationLocator, IRuntimeVersionLocator runtimeVersionLocator,
                       ICollectionLocator collectionLocator, IStartUpVersionLocator startUpVersionLocator, IMigrationService migrationService)
 {
     _migrationLocator      = migrationLocator;
     _runtimeVersionLocator = runtimeVersionLocator;
     _collectionLocator     = collectionLocator;
     _startUpVersionLocator = startUpVersionLocator;
     _migrationService      = migrationService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheService"/> class.
        /// </summary>
        /// <param name="service">Provides access to core services.</param>
        /// <param name="connection">Connection to utilized to communicate with the Redis Cache instance.</param>
        /// <param name="dataProtector">Provides protection for data being cached.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service"/> is null.
        /// or
        /// <paramref name="connection"/> is null.
        /// or
        /// <paramref name="dataProtector"/> is null.
        /// </exception>
        public CacheService(IMigrationService service, IConnectionMultiplexer connection, IDataProtector dataProtector)
        {
            service.AssertNotNull(nameof(service));
            connection.AssertNotNull(nameof(connection));
            dataProtector.AssertNotNull(nameof(dataProtector));

            this.connection = connection;
            protector       = dataProtector;
            this.service    = service;
        }
        public void TestFixtureSetUp()
        {
            dbPlatform = new SQLitePlatform();
            migrationVersionInfoManager = new DbMigrationVersionInfoManager(dbPlatform, new DbCommandExecutionStrategy(), "SchemaInfo");
            sourceConnectionString = ConfigurationManager.AppSettings["connectionString"];
            targetConnectionString = ConfigurationManager.AppSettings["secondaryConnectionString"];

            migrationService = new MigrationService(dbPlatform, migrationVersionInfoManager,
                new DbMigrationScriptExecutive(new DbCommandExecutionStrategy()), null);
        }
 public SplashPageViewModel(
     INavigationService navigationService,
     ILoggerService loggerService,
     IMigrationService migrationService,
     ISplashNavigationService splashNavigationService
     ) : base(navigationService)
 {
     _loggerService           = loggerService;
     _migrationService        = migrationService;
     _splashNavigatoinService = splashNavigationService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DistributedTokenCache"/> class.
        /// </summary>
        /// <param name="service">Provides access to core services.</param>
        /// <param name="resource">The resource being accessed.</param>
        /// <param name="key">The unique identifier for the cache entry.</param>
        /// <exception cref="ArgumentException">
        /// <paramref name="resource"/> is empty or null.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="service"/> is null.
        /// </exception>
        public DistributedTokenCache(IMigrationService service, string resource, string key = null)
        {
            service.AssertNotNull(nameof(service));
            resource.AssertNotEmpty(nameof(resource));

            this.service  = service;
            keyValue      = key;
            this.resource = resource;

            AfterAccess  = AfterAccessNotification;
            BeforeAccess = BeforeAccessNotification;
        }
Exemple #21
0
        public static GeneralSettings LoadGeneralSettings(string path, IMigrationService service = null)
        {
            if (!File.Exists(path))
            {
                return(new GeneralSettings {
                    Languages = new List <GeneralLanguageSettings>()
                });
            }

            JObject jSettings;

            using (var reader = File.OpenText(path))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    try
                    {
                        jSettings = (JObject)JToken.ReadFrom(jsonReader);
                    }
                    catch (JsonReaderException)
                    {
                        return(new GeneralSettings {
                            Languages = new List <GeneralLanguageSettings>()
                        });
                    }
                }

            var languages = new List <GeneralLanguageSettings>();

            foreach (var jSetting in jSettings)
            {
                if (!(jSetting.Value is JObject jLanguageSettings))
                {
                    continue;
                }

                var language = new GeneralLanguageSettings
                {
                    Name = jSetting.Key,
                };

                ParseGeneralSettings(jLanguageSettings, ref language, out var properties);
                if (!(service is null))
                {
                    service.MigrateGeneral(properties, ref language);
                }
                languages.Add(language);
            }

            return(new GeneralSettings {
                Languages = languages
            });
        }
Exemple #22
0
 /// <summary>
 /// Initialize a new instance of <see cref="InstallService"/>.
 /// </summary>
 /// <param name="container"></param>
 /// <param name="logService"></param>
 /// <param name="packageTrackingRepository"></param>
 /// <param name="migrationService"></param>
 public InstallService(
     IUnityContainer container,
     ILogService logService,
     IPackageTrackingRepository packageTrackingRepository,
     IMigrationService migrationService,
     IExtensionService extensionService)
 {
     this.container  = container;
     this.logService = logService;
     this.packageTrackingRepository = packageTrackingRepository;
     this.migrationService          = migrationService;
     this.extensionService          = extensionService;
 }
        public void TestFixtureSetUp()
        {
            dbPlatform = new SqlCePlatform();
            connectionString = ConfigurationManager.AppSettings["connectionString"];

            migrationVersionInfoManager = new DbMigrationVersionInfoManager(dbPlatform, new DbCommandExecutionStrategy(), "SchemaInfo");
            migrationService = new MigrationService(
                dbPlatform,
                migrationVersionInfoManager,
                new DbMigrationScriptExecutive(new DbCommandExecutionStrategy()),
                new FileSystemNativeSqlResourceProvider(
                Path.Combine(
                    GetAssemblyLocation(Assembly.GetExecutingAssembly()), "Resources")));
        }
Exemple #24
0
 public MongoMigration(
     IMigrationLocator <IDocumentMigration> documentMigrationLocator,
     IDatabaseTypeMigrationDependencyLocator databaseMigrationLocator,
     IRuntimeVersionLocator runtimeVersionLocator,
     ICollectionLocator collectionLocator,
     IStartUpVersionLocator startUpVersionLocator,
     IMigrationService migrationService)
 {
     _documentMigrationLocator = documentMigrationLocator;
     _databaseMigrationLocator = databaseMigrationLocator;
     _runtimeVersionLocator    = runtimeVersionLocator;
     _collectionLocator        = collectionLocator;
     _startUpVersionLocator    = startUpVersionLocator;
     _migrationService         = migrationService;
 }
Exemple #25
0
 public SplashPageViewModel(
     INavigationService navigationService,
     ITermsUpdateService termsUpdateService,
     ILoggerService loggerService,
     IUserDataRepository userDataRepository,
     IUserDataService userDataService,
     IMigrationService migrationService
     ) : base(navigationService)
 {
     _termsUpdateService = termsUpdateService;
     _loggerService      = loggerService;
     _userDataRepository = userDataRepository;
     _userDataService    = userDataService;
     _migrationService   = migrationService;
 }
Exemple #26
0
        public ScriptMigrationViewModel(
            IReadOnlyCollection <Project> allSolutionProjects,
            IProjectBuilder projectBuilder,
            IMigrationService migrationService,
            IMessageBoxService messageBoxService)
        {
            _allSolutionProjects = allSolutionProjects;
            _projectBuilder      = projectBuilder;
            _migrationService    = migrationService;
            _messageBoxService   = messageBoxService;

            ProjectNames       = new ObservableCollection <string>(allSolutionProjects.Select(p => p.DisplayName));
            Migrations         = new ObservableCollection <DbContextNodeViewModel>();
            _projectMigrations = new Dictionary <string, Dictionary <string, List <string> > >();

            SelectedProjectName = ProjectNames.FirstOrDefault();

            OkCommand = new AsyncCommand(okCommandExecute);
        }
Exemple #27
0
 public Application(
     IRabbitMqNotifyService rabbitMqNotifyService,
     IConsole consoleWriter,
     MarketMakerService marketMakerService,
     ILog logger,
     MarginTradingSettings marginSettings,
     IMaintenanceModeService maintenanceModeService,
     IRabbitMqService rabbitMqService,
     MatchingEngineRoutesManager matchingEngineRoutesManager,
     IMigrationService migrationService,
     IConvertService convertService,
     IFxRateCacheService fxRateCacheService,
     IExternalOrderbookService externalOrderbookService,
     IAssetsManager assetsManager,
     IAssetPairsManager assetPairsManager,
     ITradingInstrumentsManager tradingInstrumentsManager,
     ITradingConditionsManager tradingConditionsManager,
     IScheduleSettingsCacheService scheduleSettingsCacheService,
     IOvernightMarginService overnightMarginService,
     IThreadSwitcher threadSwitcher)
 {
     _rabbitMqNotifyService = rabbitMqNotifyService;
     _consoleWriter         = consoleWriter;
     _marketMakerService    = marketMakerService;
     _logger                       = logger;
     _marginSettings               = marginSettings;
     _maintenanceModeService       = maintenanceModeService;
     _rabbitMqService              = rabbitMqService;
     _matchingEngineRoutesManager  = matchingEngineRoutesManager;
     _migrationService             = migrationService;
     _convertService               = convertService;
     _fxRateCacheService           = fxRateCacheService;
     _externalOrderbookService     = externalOrderbookService;
     _assetsManager                = assetsManager;
     _assetPairsManager            = assetPairsManager;
     _tradingInstrumentsManager    = tradingInstrumentsManager;
     _tradingConditionsManager     = tradingConditionsManager;
     _scheduleSettingsCacheService = scheduleSettingsCacheService;
     _overnightMarginService       = overnightMarginService;
     _threadSwitcher               = threadSwitcher;
 }
        public void TestFixtureSetUp()
        {
            dbPlatform = new SQLitePlatform();
            connectionString = ConfigurationManager.AppSettings["connectionString"];
            dbPlatform.DeploymentManager.Deploy(connectionString, DbDeploymentMode.Redeploy);

            migrationService = new MigrationService(
                dbPlatform,
                new DbMigrationVersionInfoManager(dbPlatform, new DbCommandExecutionStrategy(), "SchemaInfo"),
                new DbMigrationScriptExecutive(new DbCommandExecutionStrategy()),
                null);

            try
            {
                MigrateTo(null);
            } // try
            catch(Exception e)
            {
                MigrateTo(0);
                Assert.Fail(e.Message);
            } // catch
        }
        public AddMigrationViewModel(
            IReadOnlyCollection <Project> allSolutionProjects,
            IProjectBuilder projectBuilder,
            IMigrationService migrationService,
            IMessageBoxService messageBoxService)
        {
            _allSolutionProjects = allSolutionProjects;
            _projectBuilder      = projectBuilder;
            _migrationService    = migrationService;
            _messageBoxService   = messageBoxService;

            _projectDbContexts = new Dictionary <string, List <DbContextInfo> >();

            ProjectNames        = new ObservableCollection <string>(allSolutionProjects.Select(p => p.DisplayName));
            DbContextClassNames = new ObservableCollection <string>();

            SelectedProjectName = ProjectNames.FirstOrDefault();
            MigrationNamespace  =
                MigrationName   = string.Empty;

            OkCommand = new AsyncCommand(okCommandExecute);
        }
Exemple #30
0
        public ShellViewModel(IMigrationService migrationService)
        {
            this.SetInactive();

            this.migrationService = migrationService;

            this.Migrations = new ObservableCollection <RecognizedMigrationFile>();
            this.seeders    = new ObservableCollection <RecognizedMigrationFile>();

            this.RestoreConnectionStrings();

            this.ProviderNames = new List <string>
            {
                "System.Data.SqlClient",
                "MySql.Data.MySqlClient"
            };

            this.model = new MigrationModel
            {
                ProviderName   = this.ProviderNames[0],
                ValidationMode = ValidationMode.Submit
            };

            this.InitAssemblyCommand();

            this.InitUpAllCommand();
            this.InitDownAllCommand();
            this.InitUpOneCommand();
            this.InitDownOneCommand();

            this.InitSeedAllCommand();
            this.InitSeedOneCommand();

            this.InitGenMigrationScriptCommand();
            this.InitGenSeedScriptCommand();
        }
Exemple #31
0
 private void RecreateChannel()
 {
     m_channel = m_channelFactory.CreateChannel();
 }
Exemple #32
0
 private void InitializeProxy()
 {
     m_pipeProxy = new MigrationServiceClient();
 }
 public MigrateController(IMigrationService migrator, IMigrationInformation migrationInformation)
 {
     _migrator = migrator;
     _migrationInformation = migrationInformation;
 }
 /// <summary>
 /// Fills the plugin schema info.
 /// </summary>
 /// <param name="plugin">The plugin.</param>
 /// <param name="migrationService">The migration service.</param>
 /// <returns></returns>
 private static IEnumerable<Migration> FillPluginSchemaInfo(ICorePlugin plugin, IMigrationService migrationService)
 {
     ISchemaInfoService schemaInfoService = ServiceLocator.Current.GetInstance<ISchemaInfoService>();
     schemaInfoService.DeleteAll();
     IEnumerable<Migration> pluginMigrations = migrationService.FindPluginMigartions(plugin.Identifier);
     foreach (Migration pluginMigration in pluginMigrations)
     {
         var schemaInfo = new SchemaInfo
         {
             Version = pluginMigration.Version
         };
         schemaInfoService.Save(schemaInfo);
     }
     return pluginMigrations;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="migrationService"></param>
 public MigratorController(IMigrationService migrationService)
 {
     this.migrationService = migrationService;
 }
 public MigrationController(IMigrationService migrationService)
 {
     _migrationService = migrationService;
 }