/// <summary> /// 销毁方法 /// </summary> public void Dispose() { if (!m_isDisposed) { m_chart = null; if (m_gridFilterResult != null) { m_gridFilterResult.UnRegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK); m_gridCellClick = null; m_gridFilterResult = null; } if (m_window != null) { m_window.StopTimer(m_timerID); m_window.UnRegisterEvent(m_timerEvent, EVENTID.TIMER); m_timerEvent = null; m_window.Close(); m_window.Dispose(); m_window = null; } if (m_xml != null) { m_xml.Dispose(); m_xml = null; } m_isDisposed = true; } }
/// <summary> /// 创建选股结果界面 /// </summary> /// <param name="native">方法库</param> public SecurityFilterResult(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\SecurityFilterResult.xml"; m_xml = new UIXmlEx(); m_xml.Native = m_native; m_xml.LoadFile(xmlPath, null); m_window = m_xml.FindControl("windowSFR") as WindowEx; m_gridFilterResult = m_xml.FindControl("gridFilterResult") as GridA; m_gridFilterResult.RowStyle.Font = new FONT("SimSun", 14, false, false, false); m_gridCellClick = new GridCellMouseEvent(GridCellClick); m_gridFilterResult.RegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK); //注册秒表 m_timerEvent = new ControlTimerEvent(CallTimer); m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER); //注册点击事件 RegisterEvents(m_window); }
/// <summary> /// 加载 /// </summary> /// <param name="name">名称</param> public void Load(String name) { if (name == "MainFrame") { m_xml = new MainFrame(); } m_xml.CreateNative(); m_native = m_xml.Native; m_native.Paint = new GdiPlusPaintEx(); m_host = new WinHostEx(); m_host.Native = m_native; m_native.Host = m_host; m_host.HWnd = Handle; m_native.AllowScaleSize = true; m_native.DisplaySize = new SIZE(ClientSize.Width, ClientSize.Height); m_xml.ResetScaleSize(GetClientSize()); m_xml.Script = new GaiaScript(m_xml); m_xml.Load(DataCenter.GetAppPath() + "\\config\\" + name + ".html"); m_native.Update(); Invalidate(); }