Exemplo n.º 1
0
        public Form_ProgressBar(int max, ManualResetEvent mrEvent, Thread th)
        {
            InitializeComponent();

            progressBar1.Maximum = max;
            addValueFunc         = new AddValueFunc(delAddValue);
            this.mrEvent         = mrEvent;
            thread = th;
        }
Exemplo n.º 2
0
        private static void _AddValue(CharHandler charHandler, CharHandler aimCharHandler, float fValue, TickData tickData, AddValueFunc func, string beginText, string endText)
        {
            HUDTextMgr.GetInst().NewText(string.Format(beginText, fValue, fValue > 0 ? "+" : string.Empty), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);
            func(aimCharHandler, fValue);
            if (null != tickData)
            {
                if (tickData.m_fUnitSec == tickData.m_fTotalSec)
                {
                    tickData.funcTick = null;
                }
                else
                {
                    tickData.funcTick = () => { func(aimCharHandler, fValue); }
                };

                tickData.funcEnd += (bool bCancel) =>
                {
                    func(aimCharHandler, -fValue);
                    HUDTextMgr.GetInst().NewText(string.Format(endText, fValue, fValue > 0 ? "-" : string.Empty), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);
                };
            }
        }