protected override void JusteBeforePositionneSurApresDragDrop(I2iObjetGraphique objet) { C2i3DEn2D obj2D = objet as C2i3DEn2D; if (obj2D != null) { obj2D.FaceVisible = m_faceAffichee; } }
private void ActualiserPanel() { if (m_editeurTopLeft.Selection.Count == 0) { m_propertyGrid.SelectedObject = null; } else { if (m_editeurTopLeft.Selection.Count == 1) { C2i3DEn2D compo = m_editeurTopLeft.Selection[0] as C2i3DEn2D; m_propertyGrid.SelectedObject = compo.Composant3D; } else { List <object> objs = new List <object>(); foreach (C2i3DEn2D element in m_editeurTopLeft.Selection) { objs.Add(element.Composant3D); } m_propertyGrid.SelectedObjects = objs.ToArray(); } } MajFormules(); m_lastComposantPourFormules = null; m_panelFormules.SuspendDrawing(); foreach (Control ctrl in m_panelFormules.Controls) { ctrl.Visible = false; ctrl.Dispose(); } m_panelFormules.Controls.Clear(); if (m_editeurTopLeft.Selection.Count == 1) { C2i3DEn2D c2d = m_editeurTopLeft.Selection[0] as C2i3DEn2D; if (c2d != null) { C2iComposant3D composant = c2d.Composant3D; m_lastComposantPourFormules = composant; Type tp = composant.GetType(); foreach (PropertyInfo propriete in tp.GetProperties()) { if (propriete.GetCustomAttributes(typeof(CanBeDynamicAttribute), true).Length != 0) { C2iExpression formule = composant.GetFormule(propriete.Name); CControlEditFormulePropriete ctrl = new CControlEditFormulePropriete(); ctrl.Parent = m_panelFormules; ctrl.Dock = DockStyle.Top; ctrl.BringToFront(); ctrl.Init(typeof(CTypeEquipement), propriete.Name, formule); } } } } m_panelFormules.ResumeDrawing(); }
protected override List <CDonneeDragDropObjetGraphique> GetDragDropData(IDataObject data) { List <CDonneeDragDropObjetGraphique> lst = base.GetDragDropData(data); foreach (CDonneeDragDropObjetGraphique donnee in lst) { C2i3DEn2D c3D = donnee.ObjetDragDrop as C2i3DEn2D; } return(lst); }
private bool CPanelEditionComposantPhysique_AfterAddElements(List <I2iObjetGraphique> nouveaux) { foreach (I2iObjetGraphique obj in nouveaux) { C2i3DEn2D composant = obj as C2i3DEn2D; if (composant != null) { composant.FaceVisible = EFaceVueDynamique.Front; } } return(true); }
public void SetSelection(List <I2iObjetGraphique> lst) { List <I2iObjetGraphique> listePourMoi = new List <I2iObjetGraphique>(); Selection.Clear(); if (ObjetEdite != null && lst != null) { lst = new List <I2iObjetGraphique>(lst); Size szRef = ObjetEdite.Size; foreach (I2iObjetGraphique obj in lst) { C2i3DEn2D c3D = obj as C2i3DEn2D; if (c3D != null) { listePourMoi.Add(c3D.Composant3D.Get2D(VueAffichee)); } } Selection.AddRange(listePourMoi); } }