//--------------------------------------------------------------- public void AttacheToControl(IControleFormulaireExterne ctrl) { Name = ctrl.Name; m_listeProprietesExternes.Clear(); CDefinitionProprieteDynamique[] defs = ctrl.GetProprietes(); if (defs != null) { m_listeProprietesExternes.AddRange(defs); } m_listeEvenements.Clear(); CDescriptionEvenementParFormule[] descs = ctrl.GetDescriptionsEvenements(); if (descs != null) { m_listeEvenements.AddRange(descs); } base.IsLock = false; I2iObjetGraphique parent = Parent; Parent = null; base.Size = ctrl.Size; base.Position = ctrl.Location; Parent = parent; base.IsLock = true; }
public CWndFor2iWndFormulaireEnSurimpression(Control controleAssocie) { m_controleAssocie = controleAssocie; IControleFormulaireExterne ctrlExterne = controleAssocie as IControleFormulaireExterne; if (ctrlExterne != null) { ctrlExterne.AttacheToWndFor2iWnd(this); } }
// //////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Création des contrôles windows /// </summary> /// <param name="controlParent"></param> /// <param name="wndParent"></param> /// <param name="tooltip"></param> /// <returns></returns> public virtual CResultAErreur CreateControlesEnSurimpression( Control controlParent, C2iWnd wndParent, IFournisseurProprietesDynamiques fournisseur) { CResultAErreur result = CResultAErreur.True; m_controlesPrincipaux.Clear(); CWndFor2iWndFormulaireEnSurimpression ctrlPrincipal = new CWndFor2iWndFormulaireEnSurimpression(controlParent); ctrlPrincipal.CreateControle(this, wndParent, controlParent, fournisseur); /*if (ctrlPrincipal != null && * ctrlPrincipal.Control != null) * ctrlPrincipal.Control.Dock = DockStyle.Fill;*/ //Ajoute les contrôles externes foreach (C2iWndControleExterne ctrlEx in from wnd in wndParent.Childs where wnd is C2iWndControleExterne select wnd as C2iWndControleExterne) { //Cherche le contrôle dans le parent Control associe = FindControl(ctrlEx, controlParent); if (associe != null) { IControleFormulaireExterne ex = CEncapsuleurControleToControleFormulaireExterne.GetControleFormulaireExterne(associe, controlParent); if (ex != null) { CWndFor2iControleExterne newWnd = new CWndFor2iControleExterne(ex); newWnd.CreateControle(this, ctrlEx, controlParent, fournisseur); newWnd.WndContainer = ctrlPrincipal; ctrlPrincipal.AddChild(newWnd); } } } if (ctrlPrincipal != null) { m_controlesPrincipaux.Add(ctrlPrincipal); } return(result); /* * foreach ( C2iWnd wnd in wndParent.Childs ) * { * IControleWndFor2iWnd ctrl = CreateControle ( wnd, controlParent, fournisseur ); * if ( ctrl != null ) * { * m_controlesPrincipaux.Add ( ctrl ); * } * * } * return result;*/ }
//------------------------------------------------------------------------------- private static void FillListeControlesExternes(Control ctrl, List <IControleFormulaireExterne> lst) { IControleFormulaireExterne cex = ctrl as IControleFormulaireExterne; if (cex != null) { lst.Add(cex); } foreach (Control child in ctrl.Controls) { FillListeControlesExternes(child, lst); } }
//---------------------------------------------------------------------------------------- public static List <IControleFormulaireExterne> GetControlesFormulaireExterne(Control parent) { List <Control> lst = new List <Control>(); FillListeControles(parent, lst); List <IControleFormulaireExterne> lstRetour = new List <IControleFormulaireExterne>(); foreach (Control ctrl in lst) { IControleFormulaireExterne ctrlEx = GetControleFormulaireExterne(ctrl, parent); if (ctrlEx != null) { lstRetour.Add(ctrlEx); } } return(lstRetour); }
public CWndFor2iControleExterne(IControleFormulaireExterne controleAssocie) { m_controleAssocie = controleAssocie; }