public Segment(Statistics.SegmentStatistics.SegmentStatisticsInternal statistics) : base(statistics.ToString()) { myStatistics = statistics; // myStatistics.MarkNewState += new Statistics.Segment.StateChanged(myStatistics_MarkNewState); // ObjectToRefresh.Add(this); }
private void RefreshSegmentPage() { SortedList <long, Statistics.SegmentStatistics.States> statesList = m_remoterServer.GetSegmentStates(); foreach (Segment cs in SegmentsListView.Items) { if (statesList.ContainsKey(cs.Parent.MyID)) { cs.ImageIndex = (int)statesList[cs.Parent.MyID]; } } if (SegmentsListView.SelectedItems.Count > 0) { //Statistics.Segment curr = ( (Segment)SegmentsListView.SelectedItems[0] ).Parent; Statistics.SegmentStatistics.SegmentStatisticsInternal curr = m_remoterServer.GetSegment(((Segment)(SegmentsListView.SelectedItems[0])).Parent.MyID); SegmentsListView.Text = curr.ToString(); labelSegStateVal.Text = curr.CurrentStateAsString; labelSegAciveVal.Text = curr.ConnectTime.ToString(); labelSegConnectionsVal.Text = curr.GetMadeCount.ToString(); labelSegConnFailVal.Text = curr.GetFailCount.ToString(); labelSegWriteDelayVal.Text = curr.WriteDelay; labelSegReadDelayVal.Text = curr.ReadDelay; labelSegConnectMMAVal.Text = curr.GetSegmentConnectionTimeMinimumMximumAverage; labelSegDataOvertimeVal.Text = curr.GetOvertimeCoefficient; groupBoxSegmentCurr.Text = curr.ToString() + " statistics"; } else { SegmentsListView.Text = ns; labelSegStateVal.Text = ns; labelSegAciveVal.Text = ns; labelSegConnectionsVal.Text = ns; labelSegConnFailVal.Text = ns; labelSegWriteDelayVal.Text = ns; labelSegReadDelayVal.Text = ns; labelSegConnectMMAVal.Text = ns; labelSegDataOvertimeVal.Text = ns; } }