Пример #1
0
 private void OnGraticuleRemoved(object sender, EventArgs e)
 {
     if (_graticule != null)
     {
         _graticule.Dispose();
         _graticule          = null;
         MapLegend.Graticule = null;
     }
 }
Пример #2
0
        public void ShowGraticuleForm()
        {
            _graticule = new Graticule(axMap, _mapLayersHandler);
            var gf = GraticuleForm.GetInstance(this);

            if (!gf.Visible)
            {
                gf.Show(this);
            }
            else
            {
                gf.BringToFront();
            }
            if (MapLegend != null)
            {
                MapLegend.Graticule = _graticule;
            }
            gf.GraticuleRemoved += OnGraticuleRemoved;
        }
Пример #3
0
 private void OnGraticuleForm_Load(object sender, EventArgs e)
 {
     _maptitle                         = "New untitled map";
     txtMapTitle.Text                  = _maptitle;
     txtName.Text                      = "Graticule";
     txtLabelSize.Text                 = "8";
     txtBordeWidth.Text                = "2";
     txtGridlineWidth.Text             = "1";
     txtNumberOfGridlines.Text         = "5";
     chkBottom.Checked                 = true;
     chkTop.Checked                    = true;
     chkLeft.Checked                   = true;
     chkRight.Checked                  = true;
     chkShowGrid.Checked               = true;
     Graticule                         = _parentForm.Graticule;
     Graticule.MapTitle                = _maptitle;
     Graticule.GraticuleExtentChanged += OnGraticuleExtentChanged;
     Graticule.MapRedrawNeeded        += OnRedrawNeeded;
 }
Пример #4
0
        public void SetGraticuleTitle(string title)
        {
            bool formFound = false;

            if (Graticule != null)
            {
                foreach (Form f in Application.OpenForms)
                {
                    if (f.Name == "GraticuleForm")
                    {
                        GraticuleForm frm = (GraticuleForm)f;
                        frm.SetGraticuleTitle(title);
                        formFound = true;
                        break;
                    }
                }
                if (!formFound)
                {
                    Graticule.MapTitle = title;
                    Graticule.Refresh();
                }
            }
        }