コード例 #1
0
ファイル: ProtocolGUI.cs プロジェクト: RManPT/HOH-DEMO
        private void updateGUI(HOHEvent e)
        {
            Random rnd = new Random();

            if (e.ExerciseName != null)
            {
                lblExerciseName.Text = (e.ExerciseName + Environment.NewLine);
            }

            if (e.LaunchReward)
            {
                lblExerciseMsg.Text = c.Rewards[rnd.Next(c.Rewards.Count)];
            }
            //HOHEventObj.UpdateUsrMsg(c.Rewards[rnd.Next(c.Rewards.Count)]);

            if (e.UserMsg != null)
            {
                lblExerciseMsg.Text = (e.UserMsg + Environment.NewLine);
            }

            lblExerciseTime.Text = Utils.TimeToStr(e.ExerciseTimer);

            if (e.ProtocolState != null)
            {
                btnRestart.Enabled      = (string.Equals(e.ProtocolState, "stopped", StringComparison.OrdinalIgnoreCase));
                lblExerciseTime.Visible = (string.Equals(e.ProtocolState, "running", StringComparison.OrdinalIgnoreCase));
            }
            Thread.Yield();
        }
コード例 #2
0
 private void OnClinicEventUpdate(object sender, HOHEvent e)
 {
     // clinic = new Clinic(e.Clinic);
     clinic = null;
     clinic = e.Clinic;
     Utils.SaveToFile(defaultFileName, clinic);
     UpdateProtocols();
 }
コード例 #3
0
 private void updateGUI(HOHEvent e)
 {
     if (e.LogMsg != null)
     {
         txtProtocolsLog.AppendText(e.LogMsg + Environment.NewLine);
     }
     if (e.UserMsg != null)
     {
         txtProtocolsLog.AppendText(e.UserMsg + Environment.NewLine);
     }
     //  btnProtocolStart.Enabled = e.ProtocolGUIStatus;
 }
コード例 #4
0
 private void resetStartBtn(HOHEvent e)
 {
     btnProtocolStart.Enabled = !(bool)e.ProtocolGUIStatus;
     Debug.WriteLine(e.ProtocolGUIStatus);
 }
コード例 #5
0
        private void OnProtocolGUIStatusUpdate(object sender, HOHEvent e)
        {
            Delegate d = new EventSubscribed(resetStartBtn);

            this.Invoke(d, e);
        }
コード例 #6
0
        private void OnHOHEventUpdate(object sender, HOHEvent e)
        {
            Delegate d = new EventSubscribed(updateGUI);

            this.Invoke(d, e);
        }