private void RegisterSettings()
        {
            try
            {
                _container.Register(Castle.MicroKernel.Registration.Classes.FromAssemblyInDirectory(new AssemblyFilter(WindowsServiceSystemCore.ComponentsPath))
                                    .BasedOn <ISettings>()
                                    .WithServiceAllInterfaces()
                                    .LifestyleSingleton()
                                    );

                IDataAccessProxySettings dataAccessProxySettings = _container.Resolve <IDataAccessProxySettings>();

                // TODO

                IpEndPointsSource <IPEndPoint> .Create(2);

                dataAccessProxySettings.IpEndPoints = IpEndPointsSource <IPEndPoint> .GetInstance;
                dataAccessProxySettings.IpEndPoints.Enqueue(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 13000));
                dataAccessProxySettings.IpEndPoints.Enqueue(new IPEndPoint(IPAddress.Parse("192.168.0.106"), 13000));

                IWindowsServiceEngineSettings engineSettings = _container.Resolve <IWindowsServiceEngineSettings>();
                engineSettings.Set = int.MaxValue;
            }
            catch (Exception ex)
            {
                throw new InitializeSystemException(Resources.RegisterSettingsFailed, ex);
            }
        }
Example #2
0
        private void RegisterWindowsServiceEngineSettings(IWindowsServiceEngineSettings engineSettings)
        {
            if (_engineSettings != null)
            {
                string message = string.Format(Resources.RegisterWindowsServiceEngineSettingsError, engineSettings.GetType().Name, engineSettings.GetType().Name);

                LogTools logTools = new LogTools();
                logTools.WriteLogToConsole <Error>(message);
                logTools.WriteLogToFile <Error>(message);
            }

            _engineSettings = engineSettings;
        }