public ServerConfiguration(ModuleLoader loader, IEventLogging logging)
     : base(loader, true, logging)
 {
     string path = Path.GetFullPath(Settings.Default.UserStorageFolder);
     path = Path.Combine(path, UserStorageFile);
     UserStorageAdapter.Instance.Init(path);
 }
 public CommonConfiguration(ModuleLoader loader, ModuleConfiguration configuration, IEventLogging logging)
 {
     this.loader = loader;
     this._logging = logging;
     _config = configuration;
     _labelStorageAdapter = CreateLabelStorageAdapter(configuration);
     _systemParametersAdapter = new SystemParametersAdapter();
 }
        protected override void OnStart(string[] args)
        {
            _logging = new SystemEventLogging();
            _logging.WriteInformation("Система запущена");
            try
            {
                CheckLicense();

                _watchdog = new Thread(watchdogProc);
                _watchdog.Start();

                //System.Diagnostics.Debugger.Break();
                if (ServiceHandle != IntPtr.Zero) RequestAdditionalTime(1000 * 60 * 15);

                _loader = new ModuleLoader(_logging);
                KnownTypeProvider.ModuleList = _loader.ModuleList.ToArray();
                _config = new ServerConfiguration(_loader, _logging);
                _loginService = new LoginService(_config);
                _lockService = new LockingService(_loginService.FindSystemIdentity(), _config.EventLog);
                _worker = new PresentationWorker(_config, _lockService);

                _administrationService = new AdministrationService(_config, _loginService, _worker);

                _designService = new DesignerService(_config, _worker, _loginService, _administrationService);
                _showService = new ShowService(_config, _worker, _loginService.FindSystemIdentity());


                _designerHost = new ServiceHost(_designService);
                _showHost = new ServiceHost(_showService);
                _administrationHost = new ServiceHost(_administrationService);

                _designerHost.Open();
                _showHost.Open();
                _administrationHost.Open();
            }
            catch (Exception ex)
            {
                _logging.WriteError(ex.ToString());
                throw;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="loader"></param>
        /// <param name="checkModules"></param>
        /// <param name="logging"></param>
        /// <param name="notThrowExceptionIfInvalideConfiguration"> используется ТОЛЬКО для дизайнера в автономном режиме</param>
        public CommonConfiguration(ModuleLoader loader, bool checkModules, IEventLogging logging, bool notThrowExceptionIfInvalideConfiguration)
        {
            this.loader = loader;
            this._logging = logging;
            string labelStoragePath;
            string moduleConfigFile = String.Empty;
            string configurationSchemaFile;
            try
            {
                string moduleConfigPath = labelStoragePath = Path.GetFullPath(ConfigurationFolder);
                moduleConfigFile = Path.Combine(moduleConfigPath, ConfigurationFile);
                labelStoragePath = Path.Combine(labelStoragePath, LabelFile);
                configurationSchemaFile = Path.Combine(moduleConfigPath, ConfigurationSchemaFile);
            }
            catch (ArgumentException ex)
            {
                throw new ModuleConfigurationException(moduleConfigFile);
            }

            try
            {
                _config = LoadModuleConfiguration(moduleConfigFile, configurationSchemaFile, this.loader.ModuleList);
                if (checkModules) CheckLoadedModules();
            }
            catch(Exception ex)
            {
                if (notThrowExceptionIfInvalideConfiguration)
                {
                    _config = new InvalideModuleConfiguration() {ErrorMessage = ex.Message, InnerException = ex};
                }
                else
                {
                    throw;
                }
            }

            _systemParametersAdapter = new SystemParametersAdapter();
            _labelStorageAdapter = CreateLabelStorageAdapter(_config, labelStoragePath);
        }
 public AgentConfiguration(ModuleLoader loader, ModuleConfiguration configuration, IEventLogging logging)
     : base(loader, configuration, logging)
 {
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="loader"></param>
 /// <param name="checkModules"></param>
 /// <param name="logging"></param>
 public CommonConfiguration(ModuleLoader loader, bool checkModules, IEventLogging logging)
     : this(loader, checkModules, logging, false)
 { }
 public ClientConfiguration(ModuleLoader loader, IEventLogging logging, bool notThrowExceptionIfInvalideConfiguration) :
     base(loader, true, logging, notThrowExceptionIfInvalideConfiguration)
 {
     _isStandalone = true;
 }
 public ClientConfiguration(ModuleLoader loader, IEventLogging logging) :
     base(loader, true, logging)
 {
     _isStandalone = true;
 }
 public ClientConfiguration(ModuleLoader loader, ModuleConfiguration configuration, IEventLogging logging) :
     base(loader, configuration, logging)
 {
     _isStandalone = false;
 }