Exemplo n.º 1
0
        //-------------------------------------------------
        void itemSelectType_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem          item   = sender as ToolStripMenuItem;
            CConfigTextBoxFiltreRapide config = item != null ? item.Tag as CConfigTextBoxFiltreRapide : null;

            if (config != null)
            {
                SelectObject(config);
            }
        }
Exemplo n.º 2
0
        //------------------------------------------------------------------
        public void SelectObject()
        {
            string strText = m_textBox.Text;
            HashSet <CReferenceObjetDonnee> lstRefs = null;

            if (m_dicIntellisense != null && strText.Trim().Length > 0 && m_dicIntellisense.TryGetValue(strText.ToUpper(), out lstRefs))
            {
                if (lstRefs.Count == 1)
                {
                    SelectedObject = lstRefs.ElementAt(0).GetObjet(CSc2iWin32DataClient.ContexteCourant);
                    return;
                }
            }
            if (m_configDefaut == null && m_listeConfigs.Count == 1)
            {
                m_configDefaut = m_listeConfigs[0];
            }
            if (m_configDefaut == null)
            {
                foreach (IDisposable dis in new ArrayList(m_menuChooseType.Items))
                {
                    dis.Dispose();
                }
                m_menuChooseType.Items.Clear();
                foreach (CConfigTextBoxFiltreRapide config in m_listeConfigs)
                {
                    ToolStripMenuItem itemSelectType = new ToolStripMenuItem(config.LibelleConfig);
                    itemSelectType.Tag = config;
                    Image img = DynamicClassAttribute.GetImage(config.TypeObjets);
                    if (img != null)
                    {
                        itemSelectType.Image = img;
                    }
                    m_menuChooseType.Items.Add(itemSelectType);
                    itemSelectType.Click += new EventHandler(itemSelectType_Click);
                }
                if (m_menuChooseType.Items.Count > 0)
                {
                    m_menuChooseType.Show(m_btn, new Point(0, m_btn.Height));
                }
            }
            else
            {
                SelectObject(m_configDefaut);
            }
        }
Exemplo n.º 3
0
        //-------------------------------------------------
        private void SelectObject(CConfigTextBoxFiltreRapide config)
        {
            if (config != null)
            {
                m_configDefaut = config;
            }
            CObjetDonnee obj = null;
            bool         bSelectPriseEnChargeParDelegue = false;

            if (m_mySelectObjetDelegate != null)
            {
                obj = m_mySelectObjetDelegate.Invoke(config.TypeObjets, config.FiltreDeBase, m_textBox.Text, ref bSelectPriseEnChargeParDelegue);
            }
            if (m_globalSelectObjetDelegate != null && !bSelectPriseEnChargeParDelegue)
            {
                obj = m_globalSelectObjetDelegate.Invoke(config.TypeObjets, config.FiltreDeBase, m_textBox.Text, ref bSelectPriseEnChargeParDelegue);
            }
            if (!bSelectPriseEnChargeParDelegue)
            {
                obj = CFormSelectUnObjetDonnee.SelectionRechercheRapide(
                    "",
                    config.TypeObjets,
                    config.FiltreDeBase,
                    m_textBox.Text,
                    config.ProprieteAffichee,
                    "");
            }
            if (obj != null)
            {
                SelectedObject = obj;
            }
            else
            {
                SynchroniseTextEtObjet();
            }
        }
Exemplo n.º 4
0
 //------------------------------------------------------------------
 private void m_btn_Click(object sender, System.EventArgs e)
 {
     m_configDefaut = null;
     SelectObject();
 }