using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Core.Common.Base.Geometry;
using Core.Common.Controls.Commands;
using Core.Common.Gui;
using Core.Components.Gis.Data;
namespace Demo.Ringtoets.Commands
{
///
/// The command for opening a view for with some arbitrary data.
///
public class OpenMapViewCommand : ICommand
{
private readonly IDocumentViewController documentViewController;
///
/// Creates a new instance of .
///
/// The to use internally.
public OpenMapViewCommand(IDocumentViewController documentViewController)
{
this.documentViewController = documentViewController;
}
public bool Enabled
{
get
{
return true;
}
}
public bool Checked
{
get
{
return false;
}
}
public void Execute(params object[] arguments)
{
var points = new MapPointData(new Collection
{
new Point2D(1.5, 2),
new Point2D(1.1, 1),
new Point2D(0.8, 0.5)
});
var lines = new MapLineData(new Collection
{
new Point2D(0.0, 1.1),
new Point2D(1.0, 2.1),
new Point2D(1.6, 1.6)
});
var polygons = new MapPolygonData(new Collection
{
new Point2D(1.0, 1.3),
new Point2D(3.0, 2.6),
new Point2D(5.6, 1.6)
});
documentViewController.DocumentViewsResolver.OpenViewForData(new MapDataCollection(new List { points, lines, polygons }));
}
}
}