示例#1
0
 private void GraticuleForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Graticule.GraticuleExtentChanged -= OnGraticuleExtentChanged;
     Graticule.MapRedrawNeeded        -= OnRedrawNeeded;
     _instance   = null;
     _parentForm = null;
     CleanUp();
 }
示例#2
0
 public static GraticuleForm GetInstance(MapperForm parent)
 {
     if (_instance == null)
     {
         _instance = new GraticuleForm(parent);
     }
     return(_instance);
 }
示例#3
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;
        }
示例#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();
                }
            }
        }