Exemplo n.º 1
0
 public FileManager(IEventBus eventBus, ISystemConfig config, ITaskScheduler scheduler)
 {
     this.EventBus    = eventBus;
     this.Config      = config;
     this.Scheduler   = scheduler;
     this.RaisedFiles = new HashSet <string>();
 }
Exemplo n.º 2
0
 public BaseData(CountryKind country, IDateTimeTool2 variableDateTimeTool, ITurtleLogger logger, ISystemConfig systemConfig)
 {
     Country       = country;
     _dateTimeTool = variableDateTimeTool;
     _logger       = logger;
     SystemConfig  = systemConfig;
 }
Exemplo n.º 3
0
 public WiltshireSearcher(ISystemConfig systemConfig, ISearchConfig searchConfig, IWiltshireConfig configuration, ILogger logger)
 {
     _systemConfig  = systemConfig;
     _searchConfig  = searchConfig;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 4
0
 public DatasourcesContainer(IDatasourcesFabric datasourcesFabric, ISystemConfig configProvider, IEventQueueWriter eventQueue, IGameStorageClient gameStorage)
     : base(configProvider)
 {
     _datasourcesFabric = datasourcesFabric;
     _eventQueue        = eventQueue;
     _gameStorage       = gameStorage;
 }
Exemplo n.º 5
0
 public BournemouthSearcher(ISystemConfig systemConfig, ISearchConfig searchConfig, IBournemouthConfig configuration, ILogger logger)
 {
     _systemConfig  = systemConfig;
     _searchConfig  = searchConfig;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 6
0
 public HttpClientWrapper(string baseAddress, HttpMessageHandler handler, ILogger logger, ISystemConfig systemConfig) : base(handler, false)
 {
     _logger          = logger;
     _systemConfig    = systemConfig;
     this.BaseAddress = new Uri(baseAddress);
     AddDefaultRequestHeaders();
 }
Exemplo n.º 7
0
 public IdoxSearcher(INamedInstanceResolver <IIdoxConfig> configResolver, ISystemConfig systemConfig, ISearchConfig searchConfig, ILogger logger)
 {
     _systemConfig   = systemConfig;
     _searchConfig   = searchConfig;
     _configResolver = configResolver;
     _logger         = logger;
 }
Exemplo n.º 8
0
 public ClassroomVideoViewModel(ISystemConfig config)
 {
     systemConfig = config;
     readVideoSize();
     Classrooms   = new ObservableCollection <ClassRoom>();
     PlayCommand  = new DelegateCommand(OnPlayCommandExecuted);
     PauseCommand = new DelegateCommand(OnPauseCommandExecuted);
 }
Exemplo n.º 9
0
 public BaseData(CountryKind country, ITurtleLogger logger, ISystemConfig systemConfig, bool runInTestMode = false)
 {
     Country       = country;
     _dateTimeTool = DateTimeFactory.GenerateDateTimeTool(country);
     _logger       = logger;
     SystemConfig  = systemConfig;
     RunInTestMode = runInTestMode;
 }
Exemplo n.º 10
0
 public ConfigDialogModel(RadWindow view, ISystemConfig config)
 {
     currentView  = view;
     systemConfig = config;
     ServiceAdr   = systemConfig.GetConfig <string>("ServiceAddress");
     OkCommand    = new DelegateCommand(OkOp);
     OnPropertyChanged("OkCommand");
     CancelCommand = new DelegateCommand(CancelOp);
     OnPropertyChanged("CancelCommand");
 }
Exemplo n.º 11
0
        private static void RegisterGenericConfig(IUnityContainer container)
        {
            ISystemConfig systemConfig = (SystemConfig)(dynamic)ConfigurationManager.GetSection("systemConfig");

            container.RegisterInstance <ISystemConfig>(systemConfig);
            ISearchConfig searchConfig = (SearchConfig)(dynamic)ConfigurationManager.GetSection("searchConfig");

            container.RegisterInstance <ISearchConfig>(searchConfig);
            container.RegisterInstance <INamedInstanceResolver <IIdoxConfig> >(new NamedInstanceResolver <IIdoxConfig>(container));
        }
Exemplo n.º 12
0
 public ConfigActor(ISystemConfig systemConfig)
 {
     _configurationDictionary = new Dictionary <string, string>();
     _systemConfig            = systemConfig;
     Receive <ConfigMessage>(message =>
     {
         var value = GetConfig(message);
         _logger.Debug("Recieved request for {0} confing with value {1}", message.Key, value);
         Sender.Tell(value, Self);
     });
 }
Exemplo n.º 13
0
        protected override Task ExecuteAsync(CancellationToken stoppingToken)
        {
            _datasourcesFabric = _serviceScope.ServiceProvider.GetService <IDatasourcesFabric>();
            _configProvider    = _serviceScope.ServiceProvider.GetService <ISystemConfig>();
            _eventQueue        = _serviceScope.ServiceProvider.GetService <IEventQueueClient>();
            _gameStorage       = _serviceScope.ServiceProvider.GetService <IGameStorageClient>();

            _processor    = new DataprocessorBase(_configProvider, _eventQueue, _gameStorage);
            _dssContainer = new DatasourcesContainer(_datasourcesFabric, _configProvider, _eventQueue, _gameStorage);

            Task.Factory.StartNew((obj) => _dssContainer.Start(), stoppingToken, TaskCreationOptions.LongRunning);
            _processor.Start();

            return(Task.FromResult(1));
        }
Exemplo n.º 14
0
        public static HttpClientHandler CreateHttpClientHandler(ISystemConfig systemConfig, IConfiguration configuration, CookieContainer cookieContainer)
        {
            var handler = new HttpClientHandler()
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
                UseCookies             = true,
                CookieContainer        = cookieContainer,
                AllowAutoRedirect      = false,
                UseProxy = true
            };

            if (configuration.UseProxy)
            {
                handler.Proxy = new WebProxy(systemConfig);
            }

            return(handler);
        }
Exemplo n.º 15
0
        public ClassroomMonitorViewModel(RestConnection restConnection, ISystemConfig config)
        {
            this.restConnection = restConnection;

            /*
             * Dictionary<string, string> parameters = new Dictionary<string, string>();
             * JObject jo = this.restConnection.Get("api/ClassRoomInfoMaint/GetAllClassRooms", parameters);
             *
             * if (jo.Value<bool>("success"))
             * {
             *  JArray ja = jo.Value<JArray>("data");
             *  if (null != ja)
             *  {
             *      Collection<ClassRoom> classrooms = ja.ToObject<Collection<ClassRoom>>();
             *      jo = this.restConnection.Post("api/TerminalInfo/QueryLastTerminalInfos", classrooms);
             *      if (jo.Value<bool>("success"))
             *      {
             *          ja = jo.Value<JArray>("data");
             *          if (null != ja)
             *          {
             *              Collection<TerminalInfo> terminalInfos = ja.ToObject<Collection<TerminalInfo>>();
             *              foreach (var terminalInfo in terminalInfos)
             *              {
             *                  ClassRoom classroom = classrooms.Where(p => p.TerminalId.Equals(terminalInfo.TerminalId)).FirstOrDefault();
             *                  if (null != classroom)
             *                  {
             *                      terminalInfo.Name = classroom.ClassroomBuilding.BuildingName + "_" + classroom.RoomNum;
             *                  }
             *              }
             *              TerminalInfos = new ObservableCollection<TerminalInfo>(terminalInfos);
             *          }
             *      }
             *  }
             *
             * }
             */
            TerminalInfos = new ObservableCollection <TerminalInfo>();

            refreshTerminalInfos();
        }
Exemplo n.º 16
0
Arquivo: SRC.cs Projeto: 7474/SRC
        public SRC(ILoggerFactory loggerFactory)
        {
            Log = loggerFactory.CreateLogger("SRCCore");

            Help              = new Help(this);
            Event             = new Event(this);
            Expression        = new Expression(this);
            Map               = new Map(this);
            Commands          = new Commands.Command(this);
            Sound             = new Sound(this);
            Effect            = new Effect(this);
            COM               = new COM(this);
            InterMission      = new InterMission(this);
            FileHandleManager = new FileHandleManager();

            PDList  = new PilotDataList(this);
            NPDList = new NonPilotDataList(this);
            UDList  = new UnitDataList(this);
            IDList  = new ItemDataList(this);
            MDList  = new MessageDataList(this);
            EDList  = new MessageDataList(this);
            ADList  = new MessageDataList(this);
            EADList = new MessageDataList(this);
            DDList  = new DialogDataList(this);
            SPDList = new SpecialPowerDataList(this);
            ALDList = new AliasDataList(this);
            TDList  = new TerrainDataList(this);
            BCList  = new BattleConfigDataList(this);

            PList = new Pilots.Pilots(this);
            UList = new Units.Units(this);
            IList = new Items.Items(this);

            // XXX 別な実装をするならコンストラクタでは設定しない
            SystemConfig = new LocalFileConfig();
        }
Exemplo n.º 17
0
        public ClassroomTreeViewModel(RestConnection restConnection, ISystemConfig config)
        {
            this.restConnection = restConnection;
            systemConfig        = config;
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("_dc", "1502368547501");
            parameters.Add("sWhere", "{}");
            parameters.Add("page", "1");
            parameters.Add("start", "0");
            parameters.Add("limit", "10");
            JObject jo = this.restConnection.Get("api/ClassroomBuilding/QueryClassroomBuildingsIncludeClassRooms", parameters);

            if (jo.Value <bool>("success"))
            {
                JArray ja = jo.Value <JArray>("data");
                if (null != ja)
                {
                    ClassroomBuildings = new ObservableCollection <ClassroomBuilding>(ja.ToObject <Collection <ClassroomBuilding> >());
                    foreach (var classroomBuilding in ClassroomBuildings)
                    {
                        //初始化全部教学楼选中
                        classroomBuilding.IsChecked        = true;
                        classroomBuilding.PropertyChanged += new PropertyChangedEventHandler(ClassroomBuildingCheckedChange);
                        foreach (var classroom in classroomBuilding.ClassRooms)
                        {
                            //初始化全部教室选中
                            classroom.IsChecked         = true;
                            classroom.Name              = classroomBuilding.BuildingName + "_" + classroom.RoomNum;
                            classroom.ClassroomBuilding = classroomBuilding;
                            classroom.PropertyChanged  += new PropertyChangedEventHandler(ClassroomCheckedChange);
                        }
                    }
                }
            }
        }
Exemplo n.º 18
0
 public static void ToggleFlag(this ISystemConfig config, string section, string name)
 {
     config.SetFlag(section, name, !config.GetFlag(section, name));
 }
Exemplo n.º 19
0
 public Configurable(ISystemConfig configProvider)
 {
     _configurationBuffer = new T[2];
     _configurationIndex  = 1;
     _configProvider      = configProvider;
 }
Exemplo n.º 20
0
 public MinUsernameLengthRule(ISystemConfig config) : base(config.MinUsernameLength, string.Format(ExceptionResources.UsernameIsTooShort, config.MinUsernameLength)) { }
Exemplo n.º 21
0
 public WiltshireExtractor(ISystemConfig systemConfig, IWiltshireConfig configuration, ILogger logger)
 {
     _systemConfig  = systemConfig;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 22
0
 public UserStore(IDatabaseContext context, ISystemConfig config)
 {
     _context = context;
     _config = config;
 }
Exemplo n.º 23
0
 public IdoxExtractor(INamedInstanceResolver <IIdoxConfig> configResolver, ISystemConfig systemConfig, ILogger logger)
 {
     _configResolver = configResolver;
     _systemConfig   = systemConfig;
     _logger         = logger;
 }
Exemplo n.º 24
0
 public DataprocessorBase(ISystemConfig configProvider, IEventQueueReader queue, IGameStorageClient storage)
     : base(configProvider)
 {
     Queue   = queue;
     Storage = storage;
 }
Exemplo n.º 25
0
 public static IBaseData CreateBaseData(CountryKind country, ITurtleLogger logger, ISystemConfig systemConfig, bool runInTestMode = false)
 {
     return(new BaseData(country, logger, systemConfig, runInTestMode));
 }
Exemplo n.º 26
0
 public FileWriter(ILogger logger, ISystemConfig systemConfig)
 {
     _logger             = logger;
     _outputFileLocation = $"{Environment.CurrentDirectory}\\{systemConfig.OutputFileName}";
 }
Exemplo n.º 27
0
 public BournemouthExtractor(ISystemConfig systemConfig, IBournemouthConfig configuration, ILogger logger)
 {
     _systemConfig  = systemConfig;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 28
0
 public static void SetFlag(this ISystemConfig config, string section, string name, bool value)
 {
     config.SetItem(section, name, value ? "On" : "Off");
 }
Exemplo n.º 29
0
 public MinPasswordLengthRule(ISystemConfig config) : base(config.MinPasswordLength, string.Format(ExceptionResources.PasswordIsTooShort, config.MinPasswordLength)) { }
Exemplo n.º 30
0
 public static bool GetFlag(this ISystemConfig config, string section, string name)
 {
     return(config.GetItem(section, name)?.ToLower() == "on");
 }
Exemplo n.º 31
0
 public MinEmailLengthRule(ISystemConfig config) : base(config.MinEmailLength, string.Format(ExceptionResources.EmailIsTooShort, config.MinEmailLength)) { }
Exemplo n.º 32
0
        public static HttpClientWrapper CreateClient(string baseAddress, ISystemConfig systemConfig, IConfiguration configuration, ILogger logger, CookieContainer cookieContainer)
        {
            var handler = CreateHttpClientHandler(systemConfig, configuration, cookieContainer);

            return(new HttpClientWrapper(baseAddress, handler, logger, systemConfig));
        }
Exemplo n.º 33
0
        public static IBaseData CreateBaseDataWithVariableDateTimeTool(CountryKind country, DateTime startDate, ITurtleLogger logger, ISystemConfig systemConfig)
        {
            VariableDateTimeTool dateTool = new VariableDateTimeTool();

            dateTool.SetTime(startDate);

            return(new BaseData(country, dateTool, logger, systemConfig));
        }
Exemplo n.º 34
0
 public Logger(ISystemConfig systemConfig)
 {
     _logFileLocation = $"{Environment.CurrentDirectory}\\Logs\\{systemConfig.LogFileName}";
     Initialise();
 }