예제 #1
0
        private void InitializeController()
        {
            InitializeTimer();

            _configmonitor           = new ConfigurationChangeMonitor(!string.IsNullOrEmpty(_configPath)?_configPath:CommonUtility.GetExecutedPath());
            _wcfClientConfigProperty = new XmlDocConfigProperty {
                XPath = @"/configuration/system.serviceModel/client"
            };
            _configmonitor.Add(_wcfClientConfigProperty);
            _configmonitor.PropertyChanged += OnWcfClientPropertyChanged;

            CollectEndpointInfo();
            if (_endpointList.Count == 0)
            {
                throw new ConfigurationErrorsException("There is no endpoint been configurated from the configuration.");
            }

            HealthyCheck();

            _proxyHelthymonitorTimer.Enabled = true;
        }
예제 #2
0
        private void InitializeConfigChangeMonitor()
        {
            //appSettings section
            _configchangemonitor = new ConfigurationChangeMonitor(Utility.GetExecutedPath());
            var xpath = string.Format(XmlConfigProperty.AppSettingsKeyXpathFormat, "Color");

            _colorConfigProperty = new ColorConfigProperty {
                XPath = xpath
            };
            _configchangemonitor.Add(_colorConfigProperty);

            //Custom section
            _submissionGroupProperty = new StringConfigProperty {
                XPath = @"/*[local-name()='configuration']/*[local-name()='SubmisssionParameterRoot']/*[local-name()='SubmissionGroup']"
            };
            _configchangemonitor.Add(_submissionGroupProperty);
            _maxfilesizeProperty = new IntConfigProperty {
                XPath = @"/*[local-name()='configuration']/*[local-name()='SubmisssionParameterRoot']/*[local-name()='MaxFileSize']"
            };
            _configchangemonitor.Add(_maxfilesizeProperty);

            _configchangemonitor.PropertyChanged += OnCofigPropertyChanged;
        }