Exemple #1
0
 private void btnAlertPosition_Click(object sender, System.EventArgs e)
 {
     TimerPop oPos=new TimerPop("Position me!",null,null,true);
     _iAlertX=_iAlertY=-1;
     lblAlertCoords.Text="centered";
     oPos.LocationChanged+=new EventHandler(TimerPop_Coords);
     oPos.Show();
 }
Exemple #2
0
        private void teaTimer_Tick(object sender, System.EventArgs e)
        {
            bool bProcessAlert=false, bVisualAlert=false;
            _TeaTimer oTT=(_TeaTimer)sender;
            oTT.Stop();
            removeTimer(oTT);

            //check for process alert
            bProcessAlert=(oTT.ProcessAlert.Length>0) ;

            //visual and audible alert
            if(oTT.VisualAlert.Length>0)
            {
                if(bProcessAlert && !cbxVisualProcessAlert.Checked) goto EndVisualAlert;
                bVisualAlert=true;
                TimerPop oPop=new TimerPop(oTT.Name,oTT.VisualAlert,
                    ((bProcessAlert && !cbxAudibleProcessAlert.Checked)?null:oTT.AudibleAlert));
                if(_iAlertX!=-1 && _iAlertY!=-1)
                {
                    oPop.Left=_iAlertX;
                    oPop.Top=_iAlertY;
                }
                oPop.Show();
            }
            EndVisualAlert:{}

            //audible alert only
            if(!bVisualAlert && oTT.AudibleAlert.Length>0)
            {
                if(bProcessAlert && !cbxAudibleProcessAlert.Checked) goto EndAudibleAlert;
                playSound(oTT.AudibleAlert);
            }
            EndAudibleAlert:{}

            //execute process alert
            if(bProcessAlert) runProcess(oTT.ProcessAlert);

            //if this timer is recurring, add it again
            if(oTT.Recurring) addTimerNoAlert(oTT);
        }