public DropTreeNode(IDircectionStatistics direction) { _direction = direction; if (direction.Drop.HasValue) { Text = CultureService.Instance.GetString(CultureText.node_Drop_Text) + @": " + direction.Drop; } else { Text = CultureService.Instance.GetString(CultureText.node_Drop_Text) + @": " + AppConstants.ValueNotAvailable2; } SelectedImageKey = ImageKey = @"trash16"; TimerService.Instance.Tick += new EventHandler(Timer_Tick); EventAggregator.Instance.Subscribe <StopAppEvent>(e => { Timer_Tick(this, EventArgs.Empty); /*Leállás után még rá frissít, ez KELL!*/ }); EventAggregator.Instance.Subscribe <PlayAppEvent>(e => { Timer_Tick(null, EventArgs.Empty); /*Ajánlott!*/ }); direction.Reseted += (o, e) => { Timer_Tick(this, EventArgs.Empty); }; }
public TotalTreeNode(IDircectionStatistics direction) { _direction = direction; _watch = new Stopwatch(); if (direction.Total.HasValue) { Text = CultureService.Instance.GetString(CultureText.node_Total_Text) + @": " + direction.Total; } else { Text = CultureService.Instance.GetString(CultureText.node_Total_Text) + @": " + AppConstants.ValueNotAvailable2; } SelectedImageKey = ImageKey = @"counter16"; TimerService.Instance.Tick += new EventHandler(Timer_Tick); EventAggregator.Instance.Subscribe <StopAppEvent>(e => { _watch.Stop(); Timer_Tick(this, EventArgs.Empty); /*Leállás után még rá frissít, ez KELL!*/ }); EventAggregator.Instance.Subscribe <PlayAppEvent>(e => { Timer_Tick(null, EventArgs.Empty); /*Ajánlott!*/ }); direction.Reseted += (o, e) => { _msgCountTemp = 0; _msgPerMs = AppConstants.ValueNotAvailable2; _deltaT = 0; Timer_Tick(this, EventArgs.Empty); }; }
public AdapterStatistics() { _transmitted = new DirectionStatistics(); _received = new DirectionStatistics(); }