Exemplo n.º 1
0
        /// <summary>
        /// 加载XML
        /// </summary>
        /// <param name="xmlPath">XML路径</param>
        public override void Load(String xmlPath)
        {
            LoadFile(xmlPath, null);
            DataCenter.MainUI = this;
            ControlA control = Native.GetControls()[0];

            RegisterEvents(control);
            control.RegisterEvent(new ControlTimerEvent(CallTimerEvent), EVENTID.TIMER);
            control.StartTimer(m_timerID, 10);
            control.RegisterEvent(new ControlPaintEvent(PaintDiv), EVENTID.PAINT);
            m_barrageDiv      = new BarrageDiv();
            m_barrageDiv.Dock = DockStyleA.Fill;
            Native.AddControl(m_barrageDiv);
            m_sky      = new Sky();
            m_sky.Dock = DockStyleA.Fill;
            Native.AddControl(m_sky);
            m_sky.MainFrame       = this;
            m_txtAnswer           = FindControl("txtAnswer") as iTextBox;
            m_txtAnswer.MainFrame = this;
            m_txtQuestion         = FindControl("txtQuestion") as iTextBox;
            m_lblAlarm            = GetLabel("lblAlarm");
            m_lblTime             = GetLabel("lblTime");
            m_btnStart            = GetButton("btnStart");
            m_lblType             = GetLabel("lblType");
            m_lblMode             = GetLabel("lblMode");
            (m_btnStart as RuningButton).MainFrame = this;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 加载
 /// </summary>
 /// <param name="name">名称</param>
 public void LoadXml()
 {
     m_native             = NativeHandler.CreateNative();
     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.DisplaySize = new SIZE(ClientSize.Width, ClientSize.Height);
     m_barrageDiv         = new BarrageDiv();
     m_barrageDiv.Dock    = DockStyleA.Fill;
     m_barrageDiv.TopMost = true;
     m_native.AddControl(m_barrageDiv);
     m_native.Update();
     Invalidate();
 }
Exemplo n.º 3
0
        /// <summary>
        /// 提示
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>结果</returns>
        public double ADDBARRAGE(CVariable var)
        {
            String text = "";
            int    len  = var.m_parameters.Length;

            for (int i = 0; i < len; i++)
            {
                text += m_indicator.GetText(var.m_parameters[i]);
            }
            BarrageDiv barrageDiv = (m_xml as MainFrame).FindControl("divBarrage") as BarrageDiv;
            Barrage    barrage    = new Barrage();

            barrage.Text = text;
            barrage.Mode = 0;
            barrageDiv.AddBarrage(barrage);
            return(1);
        }