protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    _majorGrid = null;
                }
                if (_sfLayout != null)
                {
                    _sfLayout.Close();
                    _sfLayout = null;
                }
                if (_layoutExtents != null)
                {
                    _layoutExtents = null;
                }
                if (_selectedMajorGridShapesExtent != null)
                {
                    _selectedMajorGridShapesExtent = null;
                }

                _axMap.SelectBoxFinal -= OnMapSelectBoxFinal;
                _axMap     = null;
                _disposed  = true;
                _hsfLayout = -1;
            }
        }
 public static Grid25CoordinateForm GetInstance(AxMap mapControl, Grid25MajorGrid majorGrid)
 {
     if (_instance == null)
     {
         _instance = new Grid25CoordinateForm(mapControl, majorGrid);
     }
     return(_instance);
 }
 public Grid25GenerateForm(MapperForm parent)
 {
     InitializeComponent();
     _parentForm                            = parent;
     _grid25MajorGrid                       = parent.Grid25MajorGrid;
     _grid25MajorGrid.LayerSaved           += OnGrid25LayerSaved;
     _grid25MajorGrid.GridRetrieved        += OnGrid25GridRetrieved;
     _grid25MajorGrid.ExtentCreatedInLayer += OnExtentCreated;
     _grid25MajorGrid.OnGridInPanelCreated += OnGridInPanelCreated;
 }
 private void CleanUp()
 {
     _parentForm      = null;
     _grid25MajorGrid = null;
     if (_labelAndGridProperties != null)
     {
         _labelAndGridProperties.Clear();
         _labelAndGridProperties = null;
     }
     _savedGridLayers = null;
     _instance        = null;
 }
Example #5
0
        private void CleanUp()
        {
            if (_grid25MajorGrid != null)
            {
                _grid25MajorGrid.Dispose();
                _grid25MajorGrid = null;

                _mapLayersHandler.Dispose();
                _mapInterActionHandler.Dispose();
                MapLegend.Dispose();
                MapLegend = null;
                GC.Collect();
            }
            axMap.Dispose();
            Dispose();
        }
Example #6
0
        public void CreateGrid25MajorGrid(fadUTMZone utmZone)
        {
            UTMZone                  = utmZone;
            _grid25MajorGrid         = new Grid25MajorGrid(axMap);
            _grid25MajorGrid.UTMZone = utmZone;
            _grid25MajorGrid.GenerateMajorGrids();
            _grid25MajorGrid.MaplayersHandler      = _mapLayersHandler;
            _grid25MajorGrid.MapInterActionHandler = _mapInterActionHandler;
            axMap.GeoProjection.SetWgs84Projection(_grid25MajorGrid.Grid25Geoprojection);
            axMap.MapUnits = tkUnitsOfMeasure.umMeters;

            var h = _mapLayersHandler.AddLayer(Grid25MajorGrid.Grid25Grid, "Grid25", true, true);

            _mapLayersHandler.LoadMapState(false);
            _grid25MajorGrid.MoveToTop();
            _mapLayersHandler.set_MapLayer(h);
        }
 private void SetupClass(Grid25MajorGrid majorGrid)
 {
     _majorGrid                = majorGrid;
     _axMap                    = _majorGrid.MapControl;
     _axMap.SelectBoxFinal    += OnMapSelectBoxFinal;
     _axMap.SendSelectBoxFinal = true;
     if (_majorGrid.SelectedShapeGridNumbers.Count > 0)
     {
         for (int n = 0; n < _majorGrid.SelectedShapeGridNumbers.Count; n++)
         {
             _majorGrid.Grid25Grid.ShapeSelected[_majorGrid.SelectedShapeGridNumbers[n]] = true;
         }
         _selectedMajorGridShapesExtent = _majorGrid.Grid25Grid.BufferByDistance(0, 0, true, true).Extents;
         _majorGrid.Grid25Grid.SelectNone();
     }
     SelectionTransparency = 75;
 }
 private void OnGrid25LayerSaved(Grid25MajorGrid s, LayerEventArg e)
 {
     _savedGridLayers.Add(e);
 }
 private void OnGrid25GridRetrieved(Grid25MajorGrid s, LayerEventArg e)
 {
     txtMapTitle.Text = e.MapTitle;
 }
 private void OnExtentCreated(Grid25MajorGrid s, ExtentDraggedBoxEventArgs e)
 {
     GridMapStatusUpdate(e.Top, e.Left, e.Right, e.Bottom, e.InDrag);
 }
 private void OnGridInPanelCreated(Grid25MajorGrid s, LayerEventArg e)
 {
     txtMapTitle.Text = e.LayerName;
 }
Example #12
0
 /// <summary>
 /// Passes a map control reference.
 /// </summary>
 /// <param name="mapControl"></param>
 public Grid25MinorGrid(AxMap mapControl, Grid25MajorGrid majorGrid)
 {
     _axMap           = mapControl;
     _grid25MajorGrid = majorGrid;
 }
 public Grid25CoordinateForm(AxMap mapControl, Grid25MajorGrid majorGrid)
 {
     _mapControl = mapControl;
     _majorGrid  = majorGrid;
     InitializeComponent();
 }
 public Grid25LayoutHelper(Grid25MajorGrid majorGrid, int iconHandle)
 {
     LayoutTemplateFromFile = false;
     _hCursorDefineLayout   = iconHandle;
     SetupClass(majorGrid);
 }
 public Grid25LayoutHelper(Grid25MajorGrid majorGrid)
 {
     LayoutTemplateFromFile = false;
     SetupClass(majorGrid);
 }