using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Core.Common.Gui; using Core.Components.Charting.Data; using Core.Components.OxyPlot.Collection; using Core.Plugins.OxyPlot.Forms; namespace Core.Plugins.OxyPlot.Commands { /// /// This class describes the command for opening a with some arbitrary data. /// public class OpenChartViewCommand : IGuiCommand { public bool Enabled { get { return true; } } public bool Checked { get { return false; } } public IGui Gui { get; set; } public void Execute(params object[] arguments) { var line = new LineData(new Collection> { new Tuple(0.0, 1.1), new Tuple(1.0, 2.1), new Tuple(1.6, 1.6) }); var area = new AreaData(new Collection> { new Tuple(0.0, 1.1), new Tuple(1.0, 2.1), new Tuple(1.6, 1.6), new Tuple(1.6, 0.5), new Tuple(0.0, 0.5), new Tuple(0.0, 1.1) }); var clearArea = new AreaData(new Collection> { new Tuple(0.5, 0.5), new Tuple(0.5, 1.0), new Tuple(1.0, 1.0), new Tuple(0.5, 0.5) }); var points = new PointData(new Collection> { new Tuple(0.0, 1.1), new Tuple(0.5, 1.6), new Tuple(1.0, 2.1) }); Gui.DocumentViewsResolver.OpenViewForData(new ChartDataCollection( new List { area, clearArea, line, points })); } } }