/// <summary> /// 窗体关闭事件 /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); List <ControlA> controls = m_native.GetControls(); List <ControlA> removeControls = new List <ControlA>(); int controlsSize = controls.Count; for (int i = 0; i < controlsSize; i++) { removeControls.Add(controls[i]); } for (int i = 0; i < controlsSize; i++) { m_native.RemoveMirror(removeControls[i]); } removeControls.Clear(); if (m_native != null) { m_native.Dispose(); m_native = null; } if (m_window != null) { WindowXmlEx window = m_window; m_window = null; window.Close(); } }
/// <summary> /// 关闭窗体 /// </summary> /// <param name="var">变量</param> /// <returns>状态</returns> private double CLOSEWINDOW(CVariable var) { WindowXmlEx windowXmlEx = m_xml as WindowXmlEx; if (windowXmlEx != null) { windowXmlEx.Close(); } return(0); }