Exemplo n.º 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;
        }
Exemplo n.º 2
0
 public NancyBootstrapper(IApplicationContext applicationContext, IStatisticsManager statisticsManager, IPoolManager poolManager, IConfigManager configManager)
 {
     _applicationContext = applicationContext;
     _statisticsManager = statisticsManager;
     _poolManager = poolManager;
     _configManager = configManager;
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
        public FeedbackController()
        {
            _eventBriteApi = new EventBriteLayer();
            _configManager = new ConfigManager();

            _service = new FeedbackService();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 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.
        }
Exemplo n.º 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.
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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.
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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.
        }
Exemplo n.º 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.
        }
Exemplo n.º 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];
            };
        }
Exemplo n.º 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());
        }
Exemplo n.º 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.
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 28
0
        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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
 }
Exemplo n.º 34
0
 public LogManager(IConfigManager configManager)
 {
     _config = configManager.LogConfig;
 }
Exemplo n.º 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;
        }
Exemplo n.º 37
0
 public void init(IConfigManager configManager, IAssetManager assetManager)
 {
     PacketStructureManager.assets = assetManager;
 }
Exemplo n.º 38
0
        public LogManager(IConfigManager configManager)
        {
            _config = configManager.LogConfig;

            Initialize();
        }
Exemplo n.º 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;
 }
Exemplo n.º 40
0
 public void SetupConfigWindowViewModel()
 {
     applicationController = Substitute.For <IApplicationController>();
     configManager         = Substitute.For <IConfigManager>();
     viewModel             = new ConfigWindowViewModel(applicationController, configManager);
 }
Exemplo n.º 41
0
 public void Configure(IConfigManager configManager)
 {
     Stop();
     pomodoro.Configure(configManager);
     UpdatePropeties();
 }
Exemplo n.º 42
0
 protected Downloader(IPersistenceManager pm, IConfigManager cm)
 {
     persistence = pm;
     config      = cm;
 }
Exemplo n.º 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;
        }
Exemplo n.º 44
0
 public VideoThemeDownloader(IPersistenceManager pm, IConfigManager cm) : base(pm, cm)
 {
 }
Exemplo n.º 45
0
 private void ConfigManager_UpdateChatInterval(IConfigManager config, ProfilePropertyChangedCollectionEventArgs evt)
 {
     _updateInterval = config.GetProperty <long>("behaviour.actor.updateInterval");
 }
Exemplo n.º 46
0
 public AddSubCommand(IConfigManager configManager)
 {
     this.configManager = configManager;
 }
Exemplo n.º 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));
 }
Exemplo n.º 48
0
 public LoggingManager()
 {
     configMgr       = SharePointServiceLocator.GetCurrent().GetInstance <IConfigManager>();
     configuredAreas = new DiagnosticsAreaCollection(configMgr);
 }
Exemplo n.º 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;
 }
Exemplo n.º 51
0
 public NancyBootstrapper(IApplicationContext applicationContext, IStatisticsManager statisticsManager, IPoolManager poolManager, IConfigManager configManager)
 {
     _applicationContext = applicationContext;
     _statisticsManager  = statisticsManager;
     _poolManager        = poolManager;
     _configManager      = configManager;
 }
Exemplo n.º 52
0
 public EmailClient(IConfigManager configManager)
 {
     _configManager = configManager;
 }
Exemplo n.º 53
0
 /// <summary>
 /// 释放全局配置资源。
 /// </summary>
 /// <param name="configManager">全局配置管理器。</param>
 /// <param name="configAsset">要释放的全局配置资源。</param>
 public override void ReleaseDataAsset(IConfigManager configManager, object configAsset)
 {
     m_ResourceComponent.UnloadAsset(configAsset);
 }
Exemplo n.º 54
0
 public ConfigChanged(IConfigManager sender, IEnumerable <string> keys)
 {
     Sender = sender;
     Keys   = new List <string>(keys);
 }
Exemplo n.º 55
0
 internal static void Reset()
 {
     Current.configManagerCollection.Clear();
     globalConfigManager = null;
 }
Exemplo n.º 56
0
 public void Register(IContainerBuilder containerBuilder, IConfigManager configManager)
 {
     containerBuilder.RegisterSingleton <IBlockchainEventFilter, BlockchainEventFilter>();
     containerBuilder.RegisterSingleton <IRpcManager, RpcManager>();
     containerBuilder.RegisterSingleton <IMetricsService, MetricsService>();
 }
Exemplo n.º 57
0
 public MainViewModel(IConfigManager configManager)
 {
     ConfigManager = configManager;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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>();
        }