Index: src/Common/DelftTools.Controls.Swf/Charting/Tools/HistoryTool.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/DelftTools.Controls.Swf/Charting/Tools/HistoryTool.cs (.../HistoryTool.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/DelftTools.Controls.Swf/Charting/Tools/HistoryTool.cs (.../HistoryTool.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -17,14 +17,14 @@ /// internal class HistoryTool : ToolSeries, IHistoryTool { - private DeltaShellTChart tChart; - private int bufferHistory = 5; - private List lstLines = new List(); - + public event EventHandler ActiveChanged; + private readonly ToolTip toolTip; + private readonly DeltaShellTChart tChart; + private int bufferHistory = 5; + private readonly List lstLines = new List(); private bool toolTipIsShowing; private string shownText = ""; - public bool ShowToolTip { get; set; } /// /// Constructor for history tool @@ -35,15 +35,21 @@ { tChart = chart; - toolTip = new ToolTip {ShowAlways = false, InitialDelay = 0, UseAnimation = false, UseFading = false, AutoPopDelay = 0}; + toolTip = new ToolTip + { + ShowAlways = false, InitialDelay = 0, UseAnimation = false, UseFading = false, AutoPopDelay = 0 + }; } /// /// Amount of histories in buffer /// public int BufferHistory { - get { return bufferHistory; } + get + { + return bufferHistory; + } set { if (value >= 0) @@ -53,6 +59,38 @@ } } + public bool ShowToolTip { get; set; } + + public IChartView ChartView { get; set; } + + public bool Enabled + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public new bool Active + { + get + { + return base.Active; + } + set + { + base.Active = value; + if (ActiveChanged != null) + { + ActiveChanged(this, null); + } + } + } + /// /// Remove all history series /// @@ -72,10 +110,10 @@ public void Add(IChartSeries series) { var line = new LineChartSeries - { - Title = series.Title, - ShowInLegend = series.ShowInLegend - }; + { + Title = series.Title, + ShowInLegend = series.ShowInLegend + }; var lineSeries = (Line) line.series; @@ -90,9 +128,9 @@ var dataSource = series.DataSource; line.DataSource = dataSource is ICloneable - ? ((ICloneable) dataSource).Clone() - : dataSource; - + ? ((ICloneable) dataSource).Clone() + : dataSource; + AddLine(line); } @@ -111,7 +149,7 @@ { var linesAtPoint = new List(); - foreach(var line in lstLines) + foreach (var line in lstLines) { line.ClickableLine = true; int abovePoint = line.Clicked(e.X, e.Y); @@ -164,14 +202,14 @@ ChartView.Chart.Series.Add(line); - var lineSeries = (Line)line.series; + var lineSeries = (Line) line.series; lstLines.Add(lineSeries); //put series at the bottom - for (int i = tChart.Series.Count - 1; i > 0;i-- ) + for (int i = tChart.Series.Count - 1; i > 0; i--) { - tChart.Series.Exchange(i-1, i); + tChart.Series.Exchange(i - 1, i); } //hack: assign line pen again (and other color properties) to redo auto-color of tchart @@ -185,28 +223,5 @@ lineSeries.Color = Color.DarkGray; lineSeries.Transparency = 25; } - - public IChartView ChartView { get; set; } - - public bool Enabled - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public new bool Active - { - get { return base.Active; } - set - { - base.Active = value; - if (ActiveChanged != null) - { - ActiveChanged(this, null); - } - } - } - - public event EventHandler ActiveChanged; } } \ No newline at end of file