Пример #1
0
        public DeaAgent(ILog log, IDeaConfig config,
            INatsClient natsClient,
            IFilesManager filesManager,
            IConfigManager configManager,
            IDropletManager dropletManager,
            IWebServerAdministrationProvider webServerAdministrationProvider,
            IVarzProvider varzProvider)
        {
            this.log               = log;
            this.config            = config;
            this.natsClient        = natsClient;
            this.filesManager      = filesManager;
            this.configManager     = configManager;
            this.dropletManager    = dropletManager;
            this.webServerProvider = webServerAdministrationProvider;
            this.varzProvider      = varzProvider;

            helloMessage = new Hello(natsClient.UniqueIdentifier, config.LocalIPAddress, config.FilesServicePort);

            processTask     = new Task(ProcessLoop);
            heartbeatTask   = new Task(HeartbeatLoop);
            advertiseTask   = new Task(AdvertiseLoop);
            varzTask        = new Task(SnapshotVarz);
            monitorAppsTask = new Task(MonitorLoop);

            this.maxMemoryMB = config.MaxMemoryMB;
        }
Пример #2
0
 public NancyBootstrapper(IApplicationContext applicationContext, IStatisticsManager statisticsManager, IPoolManager poolManager, IConfigManager configManager)
 {
     _applicationContext = applicationContext;
     _statisticsManager = statisticsManager;
     _poolManager = poolManager;
     _configManager = configManager;
 }
Пример #3
0
        public KeyProxy(User user, int? hqId, IConfigManager configManager,
            ICbrManager cbrManager, IFulfillmentManager fulfillManager, ISubsidiaryManager subsidiaryManager, IHeadQuarterManager headQuarterManager)
            : base(hqId)
        {
            this.user = user;

            if (configManager == null)
                this.configManager = new ConfigManager();
            else
                this.configManager = configManager;

            if (cbrManager == null)
                this.cbrManager = new CbrManager();
            else
                this.cbrManager = cbrManager;

            if (fulfillManager == null)
                this.fulfillManager = new FulfillmentManager();
            else
                this.fulfillManager = fulfillManager;

            if (subsidiaryManager == null)
                this.subsidiaryManager = new SubsidiaryManager();
            else
                this.subsidiaryManager = subsidiaryManager;

            if (headQuarterManager == null)
                this.headQuarterManager = new HeadQuarterManager();
            else
                this.headQuarterManager = headQuarterManager;
        }
Пример #4
0
        public FeedbackController()
        {
            _eventBriteApi = new EventBriteLayer();
            _configManager = new ConfigManager();

            _service = new FeedbackService();
        }
Пример #5
0
        public Agent(ILog log, IConfig config,
            IMessagingProvider messagingProvider,
            IFilesManager filesManager,
            IConfigManager configManager,
            IDropletManager dropletManager,
            IWebServerAdministrationProvider webServerAdministrationProvider,
            IVarzProvider varzProvider)
        {
            this.log               = log;
            this.config            = config;
            this.messagingProvider = messagingProvider;
            this.filesManager      = filesManager;
            this.configManager     = configManager;
            this.dropletManager    = dropletManager;
            this.webServerProvider = webServerAdministrationProvider;
            this.varzProvider      = varzProvider;

            helloMessage = new Hello(messagingProvider.UniqueIdentifier, config.LocalIPAddress, config.FilesServicePort);

            heartbeatTask = new Task(HeartbeatLoop);
            varzTask = new Task(SnapshotVarz);
            monitorAppsTask = new Task(MonitorApps);

            this.maxMemoryMB = config.MaxMemoryMB;
        }
Пример #6
0
        public NLogLogWriter(IConfigManager configManager, string applicationName)
            : base(configManager, applicationName)
        {
            Configure(applicationName);

            _logger = LogManager.GetLogger(applicationName);
            _securityActionLogger = LogManager.GetLogger("SecurityAction");
        }
        public MainWindowViewModel(IConfigManager configManager, ITfsService tfsService = null)
        {
            StatusIndicators = new List<IBuildStatusIndicator>();
            _configManager = configManager;
            _tfsService = tfsService;

            _timer = new Timer(10000) {Enabled = false};
            _timer.Elapsed += QueryBuildStatus;
        }
Пример #8
0
        public MyJob(IConfigManager configManager)
        {
            if (configManager == null)
            {
                throw new ArgumentNullException("configManager");
            }

            this.configManager = configManager;
        }
        public WebScheduleFileFetcher(IConfigManager configManager, IFetchScheduleUrlProvider scheduleUrlProvider)
        {
            if (configManager == null)
                throw new ArgumentNullException(nameof(configManager));
            if (scheduleUrlProvider == null)
                throw new ArgumentNullException(nameof(scheduleUrlProvider));

            _configManager = configManager;
            _scheduleUrlProvider = scheduleUrlProvider;
        }
Пример #10
0
        public PoolManager(IObjectFactory objectFactory , IConfigManager configManager)
        {
            _logger = Log.ForContext<PoolManager>();
            _pools = new Dictionary<string, IPool>();

            foreach (var config in configManager.PoolConfigs)
            {
                _pools.Add(config.Coin.Symbol, objectFactory.GetPool(config));
            }
        }
Пример #11
0
        public LogWriterBase(IConfigManager configManager, string applicationName)
        {
            _logWriterConfiguration = new LogWriterConfiguration(configManager);
            _applicationName = applicationName;

            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            _refreshTimer = new System.Timers.Timer(LogLevelTimeoutMins * 60 * 1000);
            _refreshTimer.AutoReset = false;
            _refreshTimer.Elapsed += RefreshTimerElapsed;
        }
Пример #12
0
        public WebServer(INancyBootstrapper webBootstrapper, IConfigManager configManager)
        {
            _webBootstrapper = webBootstrapper;
            _logger = Log.ForContext<WebServer>();

            BindInterface = configManager.WebServerConfig.BindInterface;
            Port = configManager.WebServerConfig.Port;

            if (configManager.WebServerConfig.Enabled)
                Start();
        }
Пример #13
0
        public StatisticsManager(IConfigManager configManager, IPoolManager poolManager, IAlgorithmManager algorithmManager)
        {
            Pools = poolManager;
            Algorithms = algorithmManager;

            _config = configManager.StatisticsConfig;
            _logger = Log.ForContext<StatisticsManager>();

            _recacheTimer = new Timer(Recache, null, Timeout.Infinite, Timeout.Infinite); // create the timer as disabled.
            Recache(null); // recache data initially.
        }
Пример #14
0
        public SoftwareRepository(IObjectFactory objectFactory, IConfigManager configManager)
        {
            _logger = Log.ForContext<SoftwareRepository>();
            _storage = new List<IMiningSoftware>(); // initialize the pool storage.

            // loop through all enabled pool configurations.
            foreach (var config in configManager.SoftwareRepositoryConfig)
            {
                var entry = objectFactory.GetMiningSoftware(config); // create pool for the given configuration.
                _storage.Add(entry); // add it to storage.
            }
        }
Пример #15
0
        /// <summary>
        /// Tries to get a section of this type from the config.
        /// </summary>
        /// <param name="mgr">The config manager.</param>
        /// <param name="provider">The provider to redirect to, if found.</param>
        /// <returns><see langword="true"/> if found, otherwise <see langword="false"/></returns>
        internal static bool TryGetRedirect(IConfigManager mgr, out IConfigProvider provider)
        {
            var cfgRedir = mgr.GetSettings<ConfigurationRedirect>();

            provider = null;

            if (cfgRedir != null)
            {
                provider = cfgRedir.ActualProvider;
            }

            return (provider != null);
        }
Пример #16
0
        public DaemonManager(IPoolManager poolManager, IConfigManager configManager, IObjectFactory objectFactory)
        {
            // TODO: let all daemon's initialzied by daemon-manager.

            _logger = Log.ForContext<DaemonManager>();
            
            _poolManager = poolManager;
            _configManager = configManager;
            _objectFactory = objectFactory;

            _storage = new Dictionary<string, IDaemonClient>(); // initialize the daemon storage.

            ReadPoolDaemons(); // read pool daemons.
        }
Пример #17
0
        public WebServer(INancyBootstrapper webBootstrapper, IConfigManager configManager)
            : base(webBootstrapper)
        {
            var config = configManager.WebServerConfig;
            BindIP = config.BindInterface;
            Port = config.Port;

            _logger = Log.ForContext<WebServer>();

            if (config.Enabled)
                Start();
            else
                _logger.Verbose("Skipping web-server initialization as it disabled.");
        }
Пример #18
0
        //private long _nextvalidorderid;
        //private string _account;
        //public long NextValidOrderId { get { return _nextvalidorderid; } }
        //public string Account { get { return _account; } }

        public BrokerService(IConfigManager configmanager, IEventAggregator eventaggregator, ILoggerFacade logger, IGlobalIdService globalidservice, BlockingCollection<Tick> tickqueue, Basket basket)
        {
            this._configmanager = configmanager;
            this._eventAggregator = eventaggregator;
            this._tickqueue = tickqueue;
            this._basket = basket;
            this._logger = logger;
            this._globalidservice = globalidservice;

            // outgoing events
            _eventAggregator.GetEvent<SendOrderEvent>().Subscribe(SendOrder);
            _eventAggregator.GetEvent<CancelOrderEvent>().Subscribe(CancelOrder);
            _eventAggregator.GetEvent<SendHistDataRequestEvent>().Subscribe(ReqHistoricalData);
        }
Пример #19
0
        public MetricsManager(IConfigManager configManager)
        {
            if (!configManager.WebServerConfig.Backend.MetricsEnabled)
                return;

            _logger = Log.ForContext<MetricsManager>();

            Metric.Config
                //.WithReporting(c => c
                //    .WithTextFileReport(string.Format("{0}/logs/metrics/report.log", FileHelpers.AssemblyRoot),TimeSpan.FromSeconds(5))
                //    .WithCSVReports(string.Format(@"{0}/logs/metrics/csv", FileHelpers.AssemblyRoot),TimeSpan.FromSeconds(5)))
                .WithErrorHandler(exception => _logger.Error("Metrics error: {0}", exception.Message));

            if (PlatformManager.Framework == Frameworks.DotNet)
                Metric.Config.WithAllCounters(); // there is a still unresolved bug with mono borking with system.security.claimsidentity.
        }
Пример #20
0
        public PoolManager(IObjectFactory objectFactory , IConfigManager configManager)
        {
            _logger = Log.ForContext<PoolManager>();
            _storage = new List<IPool>(); // initialize the pool storage.

            // loop through all enabled pool configurations.
            foreach (var config in configManager.PoolConfigs)
            {
                var pool = objectFactory.GetPool(config); // create pool for the given configuration.
                
                if(pool.Enabled) // make sure pool was succesfully initialized.
                    _storage.Add(pool); // add it to storage.
            }

            Run(); // run the initialized pools.
        }
Пример #21
0
        public HelpModule(IPoolManager poolManager, IConfigManager configManager, ISoftwareRepository softwareRepository)
            : base("/help")
        {
            Get["/faq"] = _ =>
            {
                ViewBag.Header = "Frequently Asked Questions";

                return View["faq"];
            };

            Get["/gettingstarted/"] = _ =>
            {
                var model = new GettingStartedModel
                {
                    Stack = configManager.StackConfig,
                    Pools = poolManager.GetAllAsReadOnly()
                };

                return View["gettingstarted/index", model];
            };

            Get["/gettingstarted/pool/{slug}"] = _ =>
            {
                var pool = poolManager.Get(HttpUtility.HtmlEncode(_.slug)); // find the requested pool.

                if (pool == null)
                {
                    return View["error", new ErrorViewModel
                    {
                        Details = string.Format("The requested pool does not exist: {0}", _.slug)
                    }];
                }

                var model = new GettingStartedPoolModel
                {
                    Stack = configManager.StackConfig,
                    Pool = pool
                };

                return View["gettingstarted/pool", model];
            };

            Get["/miningsoftware/"] = _ =>
            {
                return View["miningsoftware", softwareRepository];
            };
        }
Пример #22
0
        /// <summary>
        /// Initialize mock objects.
        /// </summary>
        public PoolTests()
        {
            // factory mockup.
            _objectFactory = Substitute.For<IObjectFactory>();

            // config-manager mockup
            _configManager = Substitute.For<IConfigManager>();

            // pool-config mockup.
            _config = Substitute.For<IPoolConfig>();
            _config.Daemon.Valid.Returns(true);

            // daemon client mockup.
            _daemonClient = _objectFactory.GetDaemonClient(_config.Daemon, _config.Coin);
            _daemonClient.GetInfo().Returns(new Info());
            _daemonClient.GetMiningInfo().Returns(new MiningInfo());
        }
Пример #23
0
        public MarketManager(IConfigManager configManager, IBittrexClient bittrexClient, IPoloniexClient poloniexClient, ICryptsyClient cryptsyClient)
        {
            _logger = Log.ForContext<MarketManager>();
            _storage = new HashSet<IMarketData>();
            _config = configManager.MarketsConfig;
           
            // init the exchanges.
            _exchanges = new List<IExchangeClient>
            {
                bittrexClient,
                cryptsyClient,
                poloniexClient
            };

            // update the data initially
            _timer = new Timer(Run, null, 1, Timeout.Infinite); // schedule the timer for the first run.
        }
Пример #24
0
        public MyJob(
            IConfigManager configManager,
            IDisposableResource diposableResource)
        {
            if (configManager == null)
            {
                throw new ArgumentNullException("configManager");
            }

            if (diposableResource == null)
            {
                throw new ArgumentNullException("diposableResource");
            }

            this.configManager = configManager;
            this.diposableResource = diposableResource;
        }
        Dictionary<int, int> _sid2s = new Dictionary<int, int>();             // strategy id to index in _strategyitemlist

        public StrategyGridViewModel()
        {
            _globalIdService = ServiceLocator.Current.GetInstance<IGlobalIdService>() as GlobalIdService;
            _configManagerService = ServiceLocator.Current.GetInstance<IConfigManager>() as ConfigManager;
            _logger = ServiceLocator.Current.GetInstance<ILoggerFacade>();
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _quotefeedservice = ServiceLocator.Current.GetInstance<IStrategyQuoteFeedService>() as StrategyQuoteFeedService;
            _quotefeedservice.QuoteFeeViewModel = this;

            _eventAggregator.GetEvent<InitialPositionEvent>().Subscribe(ClientGotInitialPosition);
            _eventAggregator.GetEvent<HistBarEvent>().Subscribe(ClientGotHistBar);
            //_eventaggregator.GetEvent<SendOrderEvent>().Subscribe(ClientGotOrder);
            _eventAggregator.GetEvent<OrderConfirmationEvent>().Subscribe(ClientGotOrder);
            _eventAggregator.GetEvent<OrderCancelConfirmationEvent>().Subscribe(ClientGotOrderCancelConfirmation);
            _eventAggregator.GetEvent<OrderFillEvent>().Subscribe(ClientGotOrderFilled);

            LoadStrategies();
        }
Пример #26
0
        public MainWindow()
        {
            InitializeComponent();

            _items = new ObservableCollection<TorgetItem>();

            _cfgManager = new FinnConfigManager();

            _config = _cfgManager.LoadConfiguration();

            _picker = new Picker(new WebClient { Encoding = Encoding.UTF8 }, new FinnHtmlParser());
            _picker.ScanCompeleted += PickerOnScanCompeleted;
            _picker.Run(_config);

            InitSettings(_config);

            _balloonPool = new BalloonPool(_config.BalloonTimeOut);

            DataContext = this;
        }
Пример #27
0
        public MassTransitBus(List<BusConsumer> consumers )
        {
            _configManager = new RequiredConfigManager();
            _bus = Bus.Factory.CreateUsingRabbitMq(cfg =>
            {

                cfg.Host(new Uri(_configManager.Get("Bus.Url")), h =>
                {
                    h.Username(_configManager.Get("Bus.UserName"));
                    h.Password(_configManager.Get("Bus.Password"));
                });

                foreach (BusConsumer consumer in consumers)
                {
                    cfg.ReceiveEndpoint(consumer.QueueName, consumer.ConsumerAction);
                }
            });

            _bus.Start();
        }
        public QuotePlotViewModel()
        {
            this._quoteupdateservice = ServiceLocator.Current.GetInstance<IQuoteUpdateService>() as QuoteUpdateService;
            _quoteupdateservice.PlotViewModel = this;
            this._configmanager = ServiceLocator.Current.GetInstance<IConfigManager>();
            

            // initialize tickplot model
            _tickplot = new PlotModel()
            {
                PlotMargins = new OxyThickness(50, 0, 0, 40),
                Background = OxyColors.Transparent,
                //LegendTitle = "Legend",
                LegendTextColor = OxyColors.White,
                LegendOrientation = LegendOrientation.Horizontal,
                LegendPlacement = LegendPlacement.Outside,
                LegendPosition = LegendPosition.TopRight,
                //LegendBackground = OxyColor.FromAColor(200, OxyColors.White),
                LegendBorder = OxyColors.Black
            };

            if (_configmanager.PlotRegularTradingHours)
            {
                _plotxaxisleft = DateTime.Today.Add(new TimeSpan(9, 15, 0));
                _plotxaxisright = DateTime.Today.Add(new TimeSpan(16, 15, 0));
            }
            else
            {
                _plotxaxisleft = DateTime.Today;
                _plotxaxisright = DateTime.Today.AddDays(1);
            }

            var dateAxis = new OxyPlot.Axes.DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "Time", StringFormat = "HH:mm:ss", Minimum = OxyPlot.Axes.DateTimeAxis.ToDouble(_plotxaxisleft), Maximum = OxyPlot.Axes.DateTimeAxis.ToDouble(_plotxaxisright), MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, IntervalLength = 80 };
            dateAxis.TextColor = OxyColors.White; dateAxis.TitleColor = OxyColors.White;
            _tickplot.Axes.Add(dateAxis);
            var priceAxis = new OxyPlot.Axes.LinearAxis() { Position = OxyPlot.Axes.AxisPosition.Left, Title = "Price", MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot };
            priceAxis.TextColor = OxyColors.White; priceAxis.TitleColor = OxyColors.White;
            _tickplot.Axes.Add(priceAxis);
        }
Пример #29
0
        public void Setup()
        {
            TestUtils.DeleteTestChainData();

            var containerBuilder = new SimpleInjectorContainerBuilder(new ConfigManager(
                                                                          Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config2.json"),
                                                                          new RunOptions()
                                                                          ));

            containerBuilder.RegisterModule <BlockchainModule>();
            containerBuilder.RegisterModule <ConfigModule>();
            containerBuilder.RegisterModule <StorageModule>();
            _container = containerBuilder.Build();

            _stateManager       = _container.Resolve <IStateManager>();
            _transactionManager = _container.Resolve <ITransactionManager>();
            _transactionBuilder = _container.Resolve <ITransactionBuilder>();
            _transactionSigner  = _container.Resolve <ITransactionSigner>();
            _transactionPool    = _container.Resolve <ITransactionPool>();
            _contractRegisterer = _container.Resolve <IContractRegisterer>();
            _privateWallet      = _container.Resolve <IPrivateWallet>();
            _blockManager       = _container.Resolve <IBlockManager>();
            _configManager      = _container.Resolve <IConfigManager>();
            // set chainId from config
            if (TransactionUtils.ChainId(false) == 0)
            {
                var chainId    = _configManager.GetConfig <NetworkConfig>("network")?.ChainId;
                var newChainId = _configManager.GetConfig <NetworkConfig>("network")?.NewChainId;
                TransactionUtils.SetChainId((int)chainId !, (int)newChainId !);
                HardforkHeights.SetHardforkHeights(_configManager.GetConfig <HardforkConfig>("hardfork") ?? throw new InvalidOperationException());
            }
            ServiceBinder.BindService <GenericParameterAttributes>();

            _apiService = new TransactionServiceWeb3(_stateManager, _transactionManager, _transactionBuilder, _transactionSigner,
                                                     _transactionPool, _contractRegisterer, _privateWallet);
        }
        /// <inheritdoc />
        public void Initialize(Type contextType, IConfigManager configManager, IModuleLogger logger)
        {
            _contextType   = contextType;
            _configManager = configManager;

            // Add logger
            Logger = logger;

            // Load Config
            _configName = contextType.FullName + ".DbConfig";
            Config      = _configManager.GetConfiguration <TConfig>(_configName);

            // If database is empty, fill with TargetModel name
            if (string.IsNullOrWhiteSpace(Config.Database))
            {
                Config.Database = contextType.Name;
            }

            // Create migrations configuration
            _migrationsConfiguration = CreateDbMigrationsConfiguration();

            // Load local migrations
            _migrations = GetAvailableMigrations();
        }
Пример #31
0
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_ConfigManager = GameFrameworkEntry.GetModule <IConfigManager>();
            if (m_ConfigManager == null)
            {
                Log.Fatal("Config manager is invalid.");
                return;
            }

            m_ConfigManager.LoadConfigSuccess += OnLoadConfigSuccess;
            m_ConfigManager.LoadConfigFailure += OnLoadConfigFailure;

            if (m_EnableLoadConfigUpdateEvent)
            {
                m_ConfigManager.LoadConfigUpdate += OnLoadConfigUpdate;
            }

            if (m_EnableLoadConfigDependencyAssetEvent)
            {
                m_ConfigManager.LoadConfigDependencyAsset += OnLoadConfigDependencyAsset;
            }
        }
Пример #32
0
        /// <summary>
        /// Initializes and returns an <see cref="IConfigManager"/> with the specified configs registered with initial state.
        /// </summary>
        /// <param name="configFileWriter">An action to set up the config file before config manager initializes.</param>
        /// <param name="envVarWriter">An action to set up the environments before config manager initializes.</param>
        /// <param name="config">Definitions of configs to be registered to the config manager.</param>
        /// <returns>A config manager with initial state, ready to use.</returns>
        protected IConfigManager GetConfigManagerWithInitState(Action <MockDataStore, string> configFileWriter, Action <MockEnvironmentVariableProvider> envVarWriter, params ConfigDefinition[] config)
        {
            if (configFileWriter == null)
            {
                configFileWriter = _noopFileWriter;
            }

            if (envVarWriter == null)
            {
                envVarWriter = _noopEnvVarWriter;
            }

            string configPath    = Path.GetRandomFileName();
            var    mockDataStore = new MockDataStore();

            configFileWriter(mockDataStore, configPath);
            var environmentVariables = new MockEnvironmentVariableProvider();

            envVarWriter(environmentVariables);
            ConfigInitializer ci = new ConfigInitializer(new List <string>()
            {
                configPath
            })
            {
                DataStore = mockDataStore,
                EnvironmentVariableProvider = environmentVariables
            };
            IConfigManager icm = ci.GetConfigManager();

            foreach (var configDefinition in config)
            {
                icm.RegisterConfig(configDefinition);
            }
            icm.BuildConfig();
            return(icm);
        }
Пример #33
0
 public void Setup()
 {
     _configProvider            = Substitute.For <IConfigProvider>();
     _configManager             = Substitute.For <IConfigManager>();
     _ndmConfig                 = new NdmConfig();
     _baseDbPath                = "db";
     _rocksProvider             = Substitute.For <IDbProvider>();
     _mongoProvider             = Substitute.For <IMongoProvider>();
     _logManager                = Substitute.For <ILogManager>();
     _blockTree                 = Substitute.For <IBlockTree>();
     _specProvider              = Substitute.For <ISpecProvider>();
     _transactionPool           = Substitute.For <ITxPool>();
     _receiptStorage            = Substitute.For <IReceiptStorage>();
     _filterStore               = Substitute.For <IFilterStore>();
     _filterManager             = Substitute.For <IFilterManager>();
     _wallet                    = Substitute.For <IWallet>();
     _timestamper               = Substitute.For <ITimestamper>();
     _ecdsa                     = Substitute.For <IEthereumEcdsa>();
     _keyStore                  = Substitute.For <IKeyStore>();
     _rpcModuleProvider         = Substitute.For <IRpcModuleProvider>();
     _jsonSerializer            = Substitute.For <IJsonSerializer>();
     _cryptoRandom              = Substitute.For <ICryptoRandom>();
     _enode                     = Substitute.For <IEnode>();
     _ndmConsumerChannelManager = Substitute.For <INdmConsumerChannelManager>();
     _ndmDataPublisher          = Substitute.For <INdmDataPublisher>();
     _grpcServer                = Substitute.For <IGrpcServer>();
     _ethRequestService         = Substitute.For <IEthRequestService>();
     _notifier                  = Substitute.For <INdmNotifier>();
     _enableUnsecuredDevWallet  = false;
     _blockProcessor            = Substitute.For <IBlockProcessor>();
     _jsonRpcClientProxy        = Substitute.For <IJsonRpcClientProxy>();
     _ethJsonRpcClientProxy     = Substitute.For <IEthJsonRpcClientProxy>();
     _httpClient                = Substitute.For <IHttpClient>();
     _monitoringService         = Substitute.For <IMonitoringService>();
     _ndmModule                 = new NdmModule();
 }
Пример #34
0
 public LogManager(IConfigManager configManager)
 {
     _config = configManager.LogConfig;
 }
Пример #35
0
 /// <inheritdoc />
 public void Initialize(Type contextType, IConfigManager configManager, IModuleLogger logger)
 {
     ContextType = contextType;
 }
        public TeamMergeViewModel2017(ITeamService teamService, IMergeOperation mergeOperation, IConfigManager configManager, ILogger logger, ISolutionService solutionService)
        {
            _logger = logger;

            TeamMergeCommandsViewModel = new TeamMergeCommonCommandsViewModel(teamService, mergeOperation, configManager, logger, solutionService, SetBusyWhileExecutingAsync);

            ViewChangesetDetailsCommand = new RelayCommand(ViewChangeset, CanViewChangeset);

            Title = Resources.TeamMerge;
        }
Пример #37
0
 public void init(IConfigManager configManager, IAssetManager assetManager)
 {
     PacketStructureManager.assets = assetManager;
 }
Пример #38
0
        public LogManager(IConfigManager configManager)
        {
            _config = configManager.LogConfig;

            Initialize();
        }
Пример #39
0
 public DatabaseManager(IConfigurationRoot config, IServiceScopeFactory serviceScopeFactory, IWebHostEnvironment environment, IMemoryCache cache, IConfigManager configManager, ILogger <DatabaseManager> filelogger)
 {
     _config = config;
     _serviceScopeFactory = serviceScopeFactory;
     _environment         = environment;
     _cache         = cache;
     _configManager = configManager;
     _filelogger    = filelogger;
 }
Пример #40
0
 public void SetupConfigWindowViewModel()
 {
     applicationController = Substitute.For <IApplicationController>();
     configManager         = Substitute.For <IConfigManager>();
     viewModel             = new ConfigWindowViewModel(applicationController, configManager);
 }
Пример #41
0
 public void Configure(IConfigManager configManager)
 {
     Stop();
     pomodoro.Configure(configManager);
     UpdatePropeties();
 }
Пример #42
0
 protected Downloader(IPersistenceManager pm, IConfigManager cm)
 {
     persistence = pm;
     config      = cm;
 }
Пример #43
0
        private void RefreshInfo(AlarmPlayback playbox, int index, int count)
        {
            toolStripLabel_showInfo.Text    = "";
            toolStripLabel_alarmInfo.Text   = "";
            toolStripButton_init.Visible    = false;
            toolStripButton_start.Visible   = false;
            toolStripButton_stop.Visible    = false;
            toolStripButton_cleanup.Visible = false;
            toolStripSeparator_fl_1.Visible = false;
            toolStripSeparator_fl_2.Visible = false;

            toolStripButton_realplay.Visible = false;

            bool isVisionMonitor = false;

            bool v = count > 0;

            if (playbox != null)
            {
                CFuncNode node = playbox.LinkObj as CFuncNode;
                if (node != null)
                {
                    IMonitorConfig monitorConfig = node.ExtConfigObj as IMonitorConfig;
                    if (monitorConfig != null)
                    {
                        isVisionMonitor = ((node.ExtConfigObj as IVisionMonitorConfig) != null);
                        toolStripButton_realplay.Visible = isVisionMonitor;

                        toolStripLabel_showInfo.Text  = "“" + node.OriginText + "”";
                        toolStripLabel_alarmInfo.Text = "报警信息(" + index + "/" + count + "):";

                        IMonitor monitor = node.ExtObj as IMonitor;
                        if (monitor != null)
                        {
                            toolStripButton_init.Visible    = !monitor.IsInit;
                            toolStripButton_start.Visible   = !monitor.IsActive;
                            toolStripButton_stop.Visible    = monitor.IsActive;
                            toolStripButton_cleanup.Visible = monitor.IsInit;
                        }
                        else
                        {
                            toolStripButton_init.Visible = true;
                        }
                        toolStripSeparator_fl_1.Visible = true;
                        toolStripSeparator_fl_2.Visible = true;
                    }
                    else
                    {
                        IConfigManager <IMonitorType> monitorType = node.ExtConfigObj as IConfigManager <IMonitorType>;
                        if (monitorType != null)
                        {
                            isVisionMonitor = true;
                            toolStripLabel_showInfo.Text  = "“" + monitorType.SystemContext.Desc + "”";
                            toolStripLabel_alarmInfo.Text = "报警信息(" + index + "/" + count + "):";

                            toolStripSeparator_fl_2.Visible = v;
                        }
                    }
                }
            }

            toolStripLabel_alarmInfo.Visible = v;
            toolStripButton_first.Visible    = v && index > 0;
            toolStripButton_prior.Visible    = v && index > 0;
            toolStripButton_next.Visible     = v && index <= count;
            toolStripButton_last.Visible     = v && index <= count;

            toolStripButton_backplay.Visible = v && isVisionMonitor;
            toolStripButton_transact.Visible = v;
            toolStripButton_clear.Visible    = v;

            toolStripButton_fl.Visible    = v && !toolStripLabel_alarmInfo.Text.Equals("");
            toolStripSeparator_fl.Visible = v || isVisionMonitor;
        }
Пример #44
0
 public VideoThemeDownloader(IPersistenceManager pm, IConfigManager cm) : base(pm, cm)
 {
 }
Пример #45
0
 private void ConfigManager_UpdateChatInterval(IConfigManager config, ProfilePropertyChangedCollectionEventArgs evt)
 {
     _updateInterval = config.GetProperty <long>("behaviour.actor.updateInterval");
 }
Пример #46
0
 public AddSubCommand(IConfigManager configManager)
 {
     this.configManager = configManager;
 }
Пример #47
0
 public TransactionService(INdmBlockchainBridge blockchainBridge, IWallet wallet, IConfigManager configManager,
                           string configId, ILogManager logManager)
 {
     _blockchainBridge = blockchainBridge ?? throw new ArgumentNullException(nameof(blockchainBridge));
     _wallet           = wallet ?? throw new ArgumentNullException(nameof(wallet));
     _configManager    = configManager ?? throw new ArgumentNullException(nameof(configManager));
     _configId         = configId ?? throw new ArgumentNullException(nameof(configId));
     _logger           = logManager.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
 }
Пример #48
0
 public LoggingManager()
 {
     configMgr       = SharePointServiceLocator.GetCurrent().GetInstance <IConfigManager>();
     configuredAreas = new DiagnosticsAreaCollection(configMgr);
 }
Пример #49
0
 //private string encrypt;
 public LicenseRepository()
 {
     serviceLocator = SharePointServiceLocator.GetCurrent();
     configManager  = serviceLocator.GetInstance <IConfigManager>();
     Farmbag        = (SPFarmPropertyBag)configManager.GetPropertyBag(ConfigLevel.CurrentSPFarm);
 }
 /// <summary>
 /// Constructs the diagnostics area collection
 /// </summary>
 /// <param name="configMgr">the instance of configuration manager to use when loading areas</param>
 public DiagnosticsAreaCollection(IConfigManager configMgr)
     : base(LoadAreas(configMgr))
 {
     this.configMgr = configMgr;
 }
Пример #51
0
 public NancyBootstrapper(IApplicationContext applicationContext, IStatisticsManager statisticsManager, IPoolManager poolManager, IConfigManager configManager)
 {
     _applicationContext = applicationContext;
     _statisticsManager  = statisticsManager;
     _poolManager        = poolManager;
     _configManager      = configManager;
 }
Пример #52
0
 public EmailClient(IConfigManager configManager)
 {
     _configManager = configManager;
 }
Пример #53
0
 /// <summary>
 /// 释放全局配置资源。
 /// </summary>
 /// <param name="configManager">全局配置管理器。</param>
 /// <param name="configAsset">要释放的全局配置资源。</param>
 public override void ReleaseDataAsset(IConfigManager configManager, object configAsset)
 {
     m_ResourceComponent.UnloadAsset(configAsset);
 }
Пример #54
0
 public ConfigChanged(IConfigManager sender, IEnumerable <string> keys)
 {
     Sender = sender;
     Keys   = new List <string>(keys);
 }
Пример #55
0
 internal static void Reset()
 {
     Current.configManagerCollection.Clear();
     globalConfigManager = null;
 }
Пример #56
0
 public void Register(IContainerBuilder containerBuilder, IConfigManager configManager)
 {
     containerBuilder.RegisterSingleton <IBlockchainEventFilter, BlockchainEventFilter>();
     containerBuilder.RegisterSingleton <IRpcManager, RpcManager>();
     containerBuilder.RegisterSingleton <IMetricsService, MetricsService>();
 }
Пример #57
0
 public MainViewModel(IConfigManager configManager)
 {
     ConfigManager = configManager;
 }
Пример #58
0
 public FComment(string label, string valType, IFormFactory formFactory, IStatProvider statProvider, IErrorOutput errorOutput, IIlsProvider ilsProvider, IConfigManager configManager, NotificationManager notify, IOperationProgress operationProgress, ChangeTracker changeTracker)
 {
     this.configManager = configManager;
     this.valType       = valType;
     this.label         = label;
     InitializeComponent();
     this.notify            = notify;
     this.operationProgress = operationProgress;
     this.statProvider      = statProvider;
     this.changeTracker     = changeTracker;
     notify.ParentForm      = this;
     this.formFactory       = formFactory;
     this.errorOutput       = errorOutput;
     this.ilsProvider       = ilsProvider;
     FormClosing           += FComment_FormClosing;
     Closed += FComment_Closed;
 }
Пример #59
0
 /// <summary>
 /// 文件系统管理器
 /// </summary>
 /// <param name="configManager">配置管理器</param>
 public TimeManager(IConfigManager configManager)
 {
     this.configManager = configManager;
 }
        public TeamMergeCommonCommandsViewModel(ITeamService teamService, IMergeOperation mergeOperation, IConfigManager configManager, ILogger logger, ISolutionService solutionService, Func <Func <Task>, Task> setBusyWhileExecutingAsync)
        {
            _teamService                = teamService;
            _mergeOperation             = mergeOperation;
            _configManager              = configManager;
            _logger                     = logger;
            _solutionService            = solutionService;
            _setBusyWhileExecutingAsync = setBusyWhileExecutingAsync;

            MergeCommand           = new AsyncRelayCommand(MergeAsync, CanMerge);
            FetchChangesetsCommand = new AsyncRelayCommand(FetchChangesetsAsync, CanFetchChangesets);
            SelectWorkspaceCommand = new RelayCommand <Workspace>(SelectWorkspace);
            OpenSettingsCommand    = new RelayCommand(OpenSettings);
            SwitchTargetAndSourceBranchesCommand = new RelayCommand(SwitchTargetAndSourceBranches, CanSwitchTargetAndSourceBranches);

            SourcesBranches = new ObservableCollection <string>();
            TargetBranches  = new ObservableCollection <string>();
            ProjectNames    = new ObservableCollection <string>();

            Changesets         = new ObservableCollection <Changeset>();
            SelectedChangesets = new ObservableCollection <Changeset>();
        }