public void addChild(Form childForm, MagneticLocation loc) { foreach (ChildFormInfo info in m_childs) { if (info.Child == childForm) { return; } } ChildFormInfo childInfo = new ChildFormInfo(); childInfo.Child = childForm; childInfo.Location = loc; childInfo.State = MagneticState.Adsorbent; childInfo.CutstomSetLocation = false; childForm.LocationChanged += ChildForm_LocationChanged; childForm.SizeChanged += ChildForm_SizeChanged; childForm.FormClosed += ChildForm_FormClosed; m_childs.Add(childInfo); adsorbentChild(childInfo); }
public void addChild(Window childWindow, MagneticLocation loc) { foreach (ChildWindowInfo info in m_childs) { if (info.Child == childWindow) { return; } } ChildWindowInfo childInfo = new ChildWindowInfo(); childInfo.Child = childWindow; childInfo.Location = loc; childInfo.State = MagneticState.Adsorbent; childInfo.CutstomSetLocation = false; childWindow.LocationChanged += ChildWindow_LocationChanged; childWindow.SizeChanged += ChildWindow_SizeChanged; childWindow.Closed += ChildWindow_WindowClosed; m_childs.Add(childInfo); adsorbentChild(childInfo); }