Пример #1
0
 public SettingsWindow(DatasGathering.CollectorConfig _conf) {
     InitializeComponent();
     iVer.Items.Add(SnmpSharpNet.SnmpVersion.Ver1);
     iVer.Items.Add(SnmpSharpNet.SnmpVersion.Ver2);
     this.Config = _conf;
     if (this.PropertyChanged != null)
         this.PropertyChanged(this, new PropertyChangedEventArgs("Config"));                    
 }
Пример #2
0
        public Page2(DatasGathering.SnmpHelper.InterfaceInfos[] ints, DatasGathering.CollectorConfig conf) {
            InitializeComponent();

            lstInts.SelectionChanged += LstInts_SelectionChanged;
            
            this._ints = ints;
            this._conf = conf;
            lstInts.ItemsSource = this._ints;
        }
Пример #3
0
        private void InitCollector(DatasGathering.CollectorConfig conf) {

            _currFileName = null;

            if (_collector != null)
                _collector.Dispose();

            _collector = new DatasGathering.DatasCollector(conf);
            _collector.DatasChanged += _collector_DatasChanged;
            _collector.StateChanged += _collector_StateChanged;
            _collector.AwaitTick += _collector_AwaitTick;
            _chart = new ChartRendering.ChartRenderer(cnvChart, _collector.Datas);            
            _chart.Render();

            lblError.Text = "";
            imgError.Visibility = Visibility.Hidden;

            var t = _collector.Start();

            grdNoConfiguration.Visibility = Visibility.Hidden;
            mnSave.IsEnabled = true;
        }
Пример #4
0
 private void _collector_StateChanged(DatasGathering.CollectorState st) {
     _currentCollectorState = st;
     if (st != DatasGathering.CollectorState.Awaiting)
         _currentCollectorRemaining = 0;
     UpdateStateStatus();
 }
Пример #5
0
        private void OpenSettings(DatasGathering.CollectorConfig initialConf = null) {
            var oldconf = _collector == null ? DatasGathering.CollectorConfig.Default() : _collector.Config;
            var initial = initialConf ?? (DatasGathering.CollectorConfig)oldconf.Clone();

            var win = new SettingsWindow(initial) { Owner = this };

            if (true == win.ShowDialog()) {
                var conf = win.Config;
                var reset = _collector == null ||
                    conf.SnmpPort != oldconf.SnmpPort || conf.TargetCommunity != oldconf.TargetCommunity ||
                                conf.TargetHost != oldconf.TargetHost || conf.TargetInterfaceIndex != oldconf.TargetInterfaceIndex;
                if (reset)
                    InitCollector(conf);
                else
                    _collector.Config = conf;
            }

            SetWindowInfos();
        }
Пример #6
0
 private void Page1_WizardFinished(DatasGathering.CollectorConfig conf) {
     this.Config = conf;
     this.Config.GatherInterval = 1000;
     this.DialogResult = true;
     this.Close();
 }
Пример #7
0
 public WizardWindow(DatasGathering.CollectorConfig config = null) {
     InitializeComponent();
     page1 = new Page1() { Config = config };
     page1.WizardFinished += Page1_WizardFinished;
     this.wizardFrame.Navigate(page1);
 }