Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/DecreaseFontSizeCommand.cs
===================================================================
diff -u -rf710b3aa8d8acb2ee8f24d154e256f9ca2272d28 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/DecreaseFontSizeCommand.cs (.../DecreaseFontSizeCommand.cs) (revision f710b3aa8d8acb2ee8f24d154e256f9ca2272d28)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/DecreaseFontSizeCommand.cs (.../DecreaseFontSizeCommand.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -1,7 +1,14 @@
-namespace Core.Plugins.CommonTools.Gui.Commands.Charting
+using Core.Common.Controls.Charting;
+
+namespace Core.Plugins.CommonTools.Gui.Commands.Charting
{
public class DecreaseFontSizeCommand : ChartViewCommandBase
{
+ ///
+ /// Decreases the fonts of the on the active
+ /// by one point.
+ ///
+ /// No arguments are needed when calling this method.
public override void Execute(params object[] arguments)
{
var view = View;
Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ExportChartAsImageCommand.cs
===================================================================
diff -u -rf710b3aa8d8acb2ee8f24d154e256f9ca2272d28 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ExportChartAsImageCommand.cs (.../ExportChartAsImageCommand.cs) (revision f710b3aa8d8acb2ee8f24d154e256f9ca2272d28)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ExportChartAsImageCommand.cs (.../ExportChartAsImageCommand.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -1,7 +1,13 @@
-namespace Core.Plugins.CommonTools.Gui.Commands.Charting
+using Core.Common.Controls.Charting;
+
+namespace Core.Plugins.CommonTools.Gui.Commands.Charting
{
public class ExportChartAsImageCommand : ChartViewCommandBase
{
+ ///
+ /// Exports the active as an image.
+ ///
+ /// No arguments are needed when calling this method.
public override void Execute(params object[] arguments)
{
var view = View;
Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/IncreaseFontSizeCommand.cs
===================================================================
diff -u -rf710b3aa8d8acb2ee8f24d154e256f9ca2272d28 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/IncreaseFontSizeCommand.cs (.../IncreaseFontSizeCommand.cs) (revision f710b3aa8d8acb2ee8f24d154e256f9ca2272d28)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/IncreaseFontSizeCommand.cs (.../IncreaseFontSizeCommand.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -1,7 +1,14 @@
-namespace Core.Plugins.CommonTools.Gui.Commands.Charting
+using Core.Common.Controls.Charting;
+
+namespace Core.Plugins.CommonTools.Gui.Commands.Charting
{
public class IncreaseFontSizeCommand : ChartViewCommandBase
{
+ ///
+ /// Increases the fonts of the on the active
+ /// by one point.
+ ///
+ /// No arguments are needed when calling this method.
public override void Execute(params object[] arguments)
{
var view = View;
Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs
===================================================================
diff -u -r3bfa4dc5fb5ea3560752479de86cb843419f8fe3 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision 3bfa4dc5fb5ea3560752479de86cb843419f8fe3)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -20,10 +20,17 @@
}
}
+ ///
+ /// Shows or hides the .
+ ///
+ ///
+ ///
+ /// - [0] - true to show the , false to hide the .
+ ///
public override void Execute(params object[] arguments)
{
- var view = RulerTool;
- if (view == null || arguments.Length == 0)
+ var rulerTool = RulerTool;
+ if (rulerTool == null || arguments.Length == 0)
{
return;
}
Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs
===================================================================
diff -u -r7e4528624b05a7a6a4526ac43a9ae43795bfe24f -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs (.../ShowChartLegendViewCommand.cs) (revision 7e4528624b05a7a6a4526ac43a9ae43795bfe24f)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ShowChartLegendViewCommand.cs (.../ShowChartLegendViewCommand.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -1,5 +1,6 @@
using System.Linq;
using Core.Common.Gui;
+using Core.Plugins.CommonTools.Gui.Forms.Charting;
namespace Core.Plugins.CommonTools.Gui.Commands.Charting
{
@@ -30,6 +31,11 @@
}
}
+ ///
+ /// Opens the in the UI when it was closed.
+ /// Closes the in the UI when it was open.
+ ///
+ /// No arguments are needed when calling this method.
public override void Execute(params object[] arguments)
{
var commonToolsGuiPlugin = Gui.Plugins.OfType().FirstOrDefault();
Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs
===================================================================
diff -u -r8cae5d69ac2d4cf678486ac2b457c0dfe97089d5 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs (.../ChartSeriesTreeNodePresenter.cs) (revision 8cae5d69ac2d4cf678486ac2b457c0dfe97089d5)
+++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs (.../ChartSeriesTreeNodePresenter.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -6,7 +6,8 @@
namespace Core.Plugins.CommonTools.Gui.Forms.Charting
{
- internal class ChartSeriesTreeNodePresenter : TreeViewNodePresenterBase {
+ public class ChartSeriesTreeNodePresenter : TreeViewNodePresenterBase
+ {
public override bool CanRenameNode(ITreeNode node)
{
return true;
Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Commands/Charting/ChartViewCommandBaseTest.cs
===================================================================
diff -u -rb0df2017d77cc00832a846a46518a2c96f927247 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Commands/Charting/ChartViewCommandBaseTest.cs (.../ChartViewCommandBaseTest.cs) (revision b0df2017d77cc00832a846a46518a2c96f927247)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Commands/Charting/ChartViewCommandBaseTest.cs (.../ChartViewCommandBaseTest.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -171,7 +171,7 @@
}
private class TestChartViewCommandBase : ChartViewCommandBase {
- public override void Execute(params object[] arguments)
+ public override void Execute(params object[] args)
{
throw new NotImplementedException();
}
Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Core.Plugins.CommonTools.Gui.Test.csproj
===================================================================
diff -u -r8cae5d69ac2d4cf678486ac2b457c0dfe97089d5 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Core.Plugins.CommonTools.Gui.Test.csproj (.../Core.Plugins.CommonTools.Gui.Test.csproj) (revision 8cae5d69ac2d4cf678486ac2b457c0dfe97089d5)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Core.Plugins.CommonTools.Gui.Test.csproj (.../Core.Plugins.CommonTools.Gui.Test.csproj) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -74,12 +74,17 @@
+
+ False
+ ..\..\..\..\lib\TeeChart.dll
+
+
Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartSeriesTreeNodePresenterTest.cs
===================================================================
diff -u
--- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartSeriesTreeNodePresenterTest.cs (revision 0)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartSeriesTreeNodePresenterTest.cs (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -0,0 +1,113 @@
+using System;
+using System.Drawing;
+using Core.Common.Controls.Charting;
+using Core.Common.Controls.Charting.Series;
+using Core.Common.Controls.TreeView;
+using NUnit.Framework;
+using Core.Plugins.CommonTools.Gui.Forms.Charting;
+using Steema.TeeChart.Styles;
+
+namespace Core.Plugins.CommonTools.Gui.Test.Forms.Charting
+{
+ [TestFixture]
+ public class ChartSeriesTreeNodePresenterTest
+ {
+ [Test]
+ public void DefaultConstructor_Always_PropertiesSet()
+ {
+ // Call
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+
+ // Assert
+ Assert.IsInstanceOf>(nodePresenter);
+
+ }
+
+ [Test]
+ public void CanRenameNode_Always_ReturnsTrue()
+ {
+ // Setup
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+
+ // Call
+ var result = nodePresenter.CanRenameNode(null);
+
+ // Assert
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ public void OnNodeRenamed_NoChartSeries_DoesNotThrow()
+ {
+ // Setup
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+
+ // Call
+ TestDelegate testDelegate = () => nodePresenter.OnNodeRenamed(null, String.Empty);
+
+ // Assert
+ Assert.DoesNotThrow(testDelegate);
+ }
+
+ [Test]
+ public void OnNodeRenamed_NewNodeName_ChartSeriesTitleSetToNodeName()
+ {
+ // Setup
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+ var name = "";
+ var newName = "";
+ var chartSeries = new TestChartSeries(new CustomPoint());
+ chartSeries.Title = name;
+
+ // Call
+ nodePresenter.OnNodeRenamed(chartSeries, newName);
+
+ // Assert
+ Assert.AreSame(newName, chartSeries.Title);
+ }
+
+ [Test]
+ public void RemoveNodeData_NodeNotInChartSeries_DoesNotThrow()
+ {
+ // Assert
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+ var chartSeries = new TestChartSeries(new CustomPoint());
+ var chart = new Chart();
+ chartSeries.Chart = chart;
+
+ // Precondition
+ CollectionAssert.DoesNotContain(chart.Series, chartSeries);
+
+ // Call
+ TestDelegate test = () => nodePresenter.RemoveNodeData(null, chartSeries);
+
+ // Assert
+ Assert.DoesNotThrow(test);
+ }
+
+ [Test]
+ public void RemoveNodeData_NodeInChartSeries_ChartSeriesRemoved()
+ {
+ // Assert
+ var nodePresenter = new ChartSeriesTreeNodePresenter();
+ var chartSeries = new TestChartSeries(new CustomPoint());
+ var chart = new Chart();
+ chartSeries.Chart = chart;
+ chart.AddChartSeries(chartSeries);
+
+ // Precondition
+ CollectionAssert.Contains(chart.Series, chartSeries);
+
+ // Call
+ nodePresenter.RemoveNodeData(null, chartSeries);
+
+ // Assert
+ CollectionAssert.DoesNotContain(chart.Series, chartSeries);
+ }
+ }
+
+ public class TestChartSeries : ChartSeries {
+ public TestChartSeries(CustomPoint series) : base(series) {}
+ public override Color Color { get; set; }
+ }
+}
\ No newline at end of file
Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartTreeNodePresenterTest.cs
===================================================================
diff -u -r8cae5d69ac2d4cf678486ac2b457c0dfe97089d5 -rb0ebc3d3a65294faaf85d5f3b8f612efe61c5915
--- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartTreeNodePresenterTest.cs (.../ChartTreeNodePresenterTest.cs) (revision 8cae5d69ac2d4cf678486ac2b457c0dfe97089d5)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/Forms/Charting/ChartTreeNodePresenterTest.cs (.../ChartTreeNodePresenterTest.cs) (revision b0ebc3d3a65294faaf85d5f3b8f612efe61c5915)
@@ -1,7 +1,6 @@
using System.Collections;
using Core.Common.Controls.Charting;
using Core.Common.Controls.TreeView;
-using Core.Common.Gui;
using Core.Plugins.CommonTools.Gui.Forms.Charting;
using NUnit.Framework;
using Rhino.Mocks;
@@ -23,7 +22,6 @@
var chart = mocks.Stub();
- var guiPlugin = mocks.Stub();
treeView.TreeViewNodeSorter = mocks.Stub();
mocks.ReplayAll();
@@ -50,7 +48,6 @@
var chart = mocks.Stub();
- var guiPlugin = mocks.Stub();
mocks.ReplayAll();
// Precondition