//---------------------------------------------------------------------
        private void Init(
            CConfigWndMapView config,
            CObjetPourSousProprietes objetEdite,
            IFournisseurProprietesDynamiques fournisseurProprietes)
        {
            m_configEditee          = config;
            m_fournisseurProprietes = fournisseurProprietes;
            m_objetEdite            = objetEdite;
            m_txtFormuleLatitude.Init(FournisseurProprietes, ObjetEdite);
            m_txtFormuleLongitude.Init(FournisseurProprietes, ObjetEdite);
            m_txtFormuleZoom.Init(FournisseurProprietes, ObjetEdite);
            m_txtFormuleKeepState.Init(FournisseurProprietes, ObjetEdite);

            m_txtFormuleLatitude.Formule  = m_configEditee.FormuleLatitude;
            m_txtFormuleLongitude.Formule = m_configEditee.FormuleLongitude;
            m_txtFormuleZoom.Formule      = m_configEditee.FormuleZoomFactor;
            m_txtFormuleKeepState.Formule = m_configEditee.FormulePreserveStateKey;

            m_chkPreserveCenter.Checked  = m_configEditee.PreserveCenter;
            m_chkPreserveLayers.Checked  = m_configEditee.PreserveLayers;
            m_chkPreserveMapMode.Checked = m_configEditee.PreserveMapMode;
            m_chkPreserveZoom.Checked    = m_configEditee.PreserveZoom;


            m_rbtnViewMap.Checked = config.MapMode == EWndMapMode.Map;
            m_rbtnAerial.Checked  = config.MapMode == EWndMapMode.Aerial;
            m_rbtnHybride.Checked = config.MapMode == EWndMapMode.Hybrid;

            CListeObjetDonneeGenerique <CConfigMapDatabase> lstConfigs = CConfigMapDatabase.GetConfigsFor(
                CContexteDonneeSysteme.GetInstance(),
                objetEdite);

            m_wndListeCalques.BeginUpdate();
            foreach (CConfigMapDatabase configDB in lstConfigs)
            {
                bool bIsChecked = false;
                //TESTDBKEYOK
                CConfigCalqueMap configCalque = m_configEditee.GetConfigForCalque(configDB.DbKey);
                if (configCalque == null)
                {
                    configCalque = new CConfigCalqueMap();
                    //TESTDBKEYOK
                    configCalque.KeyConfigMapDatabase = configDB.DbKey;
                }
                else
                {
                    bIsChecked = true;
                }
                configCalque.generator = configDB.MapGenerator;
                ListViewItem item = new ListViewItem(configDB.Libelle);
                item.Tag     = configCalque;
                item.Checked = bIsChecked;
                m_wndListeCalques.Items.Add(item);
            }
            m_wndListeCalques.EndUpdate();
        }
Esempio n. 2
0
        //-----------------------------------------------------------
        private void FillMenuCalques()
        {
            CListeObjetDonneeGenerique <CConfigMapDatabase> liste = CConfigMapDatabase.GetConfigsFor(
                m_objetSource is IObjetAContexteDonnee?((IObjetAContexteDonnee)m_objetSource).ContexteDonnee:CContexteDonneeSysteme.GetInstance(),
                m_objetSource == null ? null : m_objetSource.GetType());

            foreach (CConfigMapDatabase config in liste)
            {
                ToolStripMenuItem     item    = new ToolStripMenuItem(config.Libelle);
                CRuntimeConfigMapView runtime = null;
                //TESTDBKEYOK
                m_dicRuntimes.TryGetValue(config.DbKey, out runtime);
                if (runtime == null)
                {
                    runtime = GetOrCreateRuntimeConfig(config);
                }
                item.Tag             = runtime;
                item.CheckedChanged += new EventHandler(item_CheckedChanged);
                item.MouseUp        += new MouseEventHandler(item_MouseUp);
                item.ToolTipText     = I.T("Right click to setup|20013");
                m_menuCalques.Items.Add(item);
            }
        }