/// <summary> /// Creates a new instance of the frmAssignProjection class /// </summary> public AssignProjectionForm(IAppContext context) : base(context) { InitializeComponent(); if (context == null) { throw new NullReferenceException("No reference to MapWindow was passed"); } var database = context.Projections; if (database == null) { throw new InvalidCastException("Invalid instance of projection database was passed"); } LayersControl1.Initialize(context); LayersControl1.LayerAdded += delegate { RefreshControlState(); }; LayersControl1.LayerRemoved += RefreshControlState; if (ProjectionTreeView1.Initialize(database, context)) { ProjectionTreeView1.RefreshList(); } LayersControl1.ControlType = LayersControl.CustomType.Projection; RefreshControlState(); }
/// <summary> /// Creates a new instance of the frmAssignProjection class /// </summary> public ReprojectForm(IAppContext context, IReprojectingService reprojectingService) : base(context) { _reprojectingService = reprojectingService; InitializeComponent(); if (context == null) { throw new ArgumentException("No reference to MapWindow was passed"); } if (reprojectingService == null) { throw new ArgumentNullException("reprojectingService"); } var database = context.Projections; if (database == null) { throw new InvalidCastException("Invalid instance of projection database was passed"); } LayersControl1.Initialize(context); if (ProjectionTreeView1.Initialize(database, context)) { ProjectionTreeView1.RefreshList(); } LayersControl1.ControlType = LayersControl.CustomType.Projection; }
/// <summary> /// Creates a new instance of the frmAssignProjection class /// </summary> public frmReproject(MapWinGIS.Interfaces.IMapWin mapWin) { InitializeComponent(); if (mapWin == null) { throw new ArgumentException("No reference to MapWinGIS was passed"); } ProjectionDatabase database = mapWin.ProjectionDatabase as ProjectionDatabase; if (database == null) { throw new InvalidCastException("Invalid instance of projection database was passed"); } m_mapWin = mapWin; LayersControl1.Initialize(mapWin); if (ProjectionTreeView1.Initialize(database, mapWin)) { this.ProjectionTreeView1.RefreshList(); } this.LayersControl1.ControlType = LayersControl.CustomType.Projection; }
/// <summary> /// Creates a new instance of the frmAssignProjection class /// </summary> public frmAssignProjection(MapWinGIS.Interfaces.IMapWin mapWin) { InitializeComponent(); if (mapWin == null) { throw new NullReferenceException("No reference to MapWinGIS was passed"); } ProjectionDatabase database = mapWin.ProjectionDatabase as ProjectionDatabase; if (database == null) { throw new InvalidCastException("Invalid instance of projection database was passed"); } m_mapWin = mapWin; LayersControl1.Initialize(mapWin); LayersControl1.LayerAdded += delegate(string filename, DataGridView dgv, int rowIndex) { this.RefreshControlState(); }; LayersControl1.LayerRemoved += delegate() { this.RefreshControlState(); }; if (ProjectionTreeView1.Initialize(database, mapWin)) { this.ProjectionTreeView1.RefreshList(); } this.LayersControl1.ControlType = LayersControl.CustomType.Projection; this.RefreshControlState(); }