Beispiel #1
0
        public override void OnLoad()
        {
            base.OnLoad();
            for (int i = 0; i < 10; i++)
            {
                GridColumn column = new GridColumn();
                column.Width = 64;
                AddColumn(column);
            }
            Update();
            GridRow row = null;

            for (int i = 0; i < 20; i++)
            {
                if (i == 0 || i == 10)
                {
                    row        = new GridRow();
                    row.Height = 64;
                    AddRow(row);
                }
                int col = i;
                if (i >= 10)
                {
                    col -= 10;
                }
                GridIconCell gridIconCell = new GridIconCell();
                row.AddCell(col, gridIconCell);
            }
            ResourcePath   = DataCenter.GetAppPath() + "\\config\\icons\\";
            m_macroService = DataCenter.MacroService;
            m_macroService.RegisterListener(m_macroService.GetListRequestID, new ListenerMessageCallBack(MacroDatasCallBack));
            m_macroService.RegisterListener(m_macroService.OperatorRequestID, new ListenerMessageCallBack(MacroDatasCallBack));
            RegisterEvent(new ControlInvokeEvent(Invoke), EVENTID.INVOKE);
        }
Beispiel #2
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         m_chart = null;
         if (m_gridIcons != null)
         {
             m_gridIcons.UnRegisterEvent(m_gridCellClickEvent, EVENTID.GRIDCELLCLICK);
             m_gridCellClickEvent = null;
             m_gridIcons          = null;
         }
         if (m_gridMacros != null)
         {
             m_gridMacros.UnRegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridMacros = null;
         }
         if (m_macroService != null)
         {
             m_macroService.UnRegisterListener(m_macroService.OperatorRequestID, m_macroDataCallBack);
             m_macroDataCallBack = null;
             m_macroService      = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }