Пример #1
0
        public MainViewModel(IConfigReaderService configReaderService, ILogService logService, INccService nccService)
        {
            _configReaderService = configReaderService;
            _nccService          = nccService;
            _logService          = logService;

            try
            {
                NCCConfig = configReaderService.ReadNccConfig();
            }
            catch (Exception e)
            {
                _logService.LogError("WRONG CONFIG: " + e.Message);
            }



            BindingOperations.EnableCollectionSynchronization(Logs, _lock);

            if (NCCConfig.DomainSlave == false)
            {
                _nccService.StartListening("127.0.0.1", NCCConfig.ServerPort);
            }
            else
            {
                _nccService.ConnectToNcc("127.0.0.1", NCCConfig.ClientPort, NCCConfig.Name);
                _nccService.StartListening("127.0.0.1", NCCConfig.ServerPort);
            }
        }
Пример #2
0
 public NccService(ILogService logService, IObjectSerializerService objectSerializerService, IConfigReaderService configReaderService)
 {
     _logService = logService;
     _objectSerializerService = objectSerializerService;
     _nccConfig = configReaderService.ReadNccConfig();
 }