Пример #1
0
        //Ajout Item
        private void m_lnkAjouterNumerotation_LinkClicked(object sender, EventArgs e)
        {
            if (m_cmbFormatNumerotation.ElementSelectionne == null)
            {
                CFormAlerte.Afficher(I.T("Select a Numbering Format to add|1164"), EFormAlerteType.Exclamation);
                return;
            }

            CRelationSystemeCoordonnees_FormatNumerotation rel = new CRelationSystemeCoordonnees_FormatNumerotation(SystemeCoordonnees.ContexteDonnee);

            rel.CreateNewInCurrentContexte();
            rel.FormatNumerotation   = (CFormatNumerotation)m_cmbFormatNumerotation.ElementSelectionne;
            rel.SystemeDeCoordonnees = SystemeCoordonnees;
            rel.Position             = m_wndListeFormatNumerotation.Items.Count;

            ListViewItem item = new ListViewItem();

            m_wndListeFormatNumerotation.Items.Add(item);
            m_wndListeFormatNumerotation.UpdateItemWithObject(item, rel);
            foreach (ListViewItem itemSel in m_wndListeFormatNumerotation.SelectedItems)
            {
                itemSel.Selected = false;
            }
            item.Selected = true;
        }
Пример #2
0
        /// ////////////////////////////////////////////////////
        private void OnSelectionListeChange(object sender, EventArgs args)
        {
            if (DesignMode)
            {
                return;
            }
            if (m_bIsChangingSelection)
            {
                return;
            }
            m_bIsChangingSelection = true;
            if (m_objetEnCoursEdition != null &&
                m_objetEnCoursEdition.ContexteDonnee.IsEnEdition &&
                m_objetEnCoursEdition.IsValide() &&
                MAJ_Champs != null)
            {
                CObjetDonneeResultEventArgs argsMAJ = new CObjetDonneeResultEventArgs(m_objetEnCoursEdition);
                MAJ_Champs(this, argsMAJ);
                if (!argsMAJ.Result)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    CAppeleurFonctionAvecDelai.CallFonctionAvecDelai(this, "ShowErreurValidation", 1000, new Object[] { argsMAJ.Result });
                    return;
                }
                if (m_itemEnCours != null && m_itemEnCours.ListView != null /*supprimé*/)
                {
                    m_wndListe.UpdateItemWithObject(m_itemEnCours, m_objetEnCoursEdition);
                }
            }
            m_bIsChangingSelection = false;
            m_objetEnCoursEdition  = null;
            if (m_wndListe.SelectedItems.Count == 1)
            {
                m_nLastIndexDeListe   = m_wndListe.SelectedItems[0].Index;
                m_objetEnCoursEdition = (CObjetDonnee)m_wndListe.SelectedItems[0].Tag;
            }
            if (InitChamp != null)
            {
                InitChamp(this, new CObjetDonneeResultEventArgs(m_objetEnCoursEdition));
            }

            if (m_wndListe.SelectedItems.Count == 1)
            {
                m_itemEnCours = m_wndListe.SelectedItems[0];
            }
            else
            {
                m_itemEnCours = null;
            }
        }