/Main/src/DynamicDataDisplay.Markers2/Extensions/PointChartBaseExtensions.cs
C# | 46 lines | 25 code | 6 blank | 15 comment | 4 complexity | 62f2f5a845992aa91a1a95219e9027f6 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Text; 5using Microsoft.Research.DynamicDataDisplay.Markers2; 6 7namespace Microsoft.Research.DynamicDataDisplay 8{ 9 /// <summary> 10 /// Contains useful extension methods of PointChartBase class. 11 /// </summary> 12 public static class PointChartBaseExtensions 13 { 14 /// <summary> 15 /// Sets the description of chart in the legend. 16 /// </summary> 17 /// <param name="chart">The chart.</param> 18 /// <param name="description">The description.</param> 19 /// <returns></returns> 20 public static T WithDescription<T>(this T chart, string description) where T : PointChartBase 21 { 22 if (chart == null) 23 throw new ArgumentNullException("chart"); 24 25 chart.Description = description; 26 27 return chart; 28 } 29 30 /// <summary> 31 /// Stes the detailed description of chart in the legend. 32 /// </summary> 33 /// <param name="chart">The chart.</param> 34 /// <param name="detailedDescription">The detailed description.</param> 35 /// <returns></returns> 36 public static T WithDetailedDescription<T>(this T chart, string detailedDescription) where T : PointChartBase 37 { 38 if (chart == null) 39 throw new ArgumentNullException("chart"); 40 41 chart.DetailedDescription = detailedDescription; 42 43 return chart; 44 } 45 } 46}