Пример #1
0
 private bool TryCallEvent(TimerHandler eventHandler, TimerEventArgs args = null)
 {
     if (args == null)
     {
         args = new TimerEventArgs();
     }
     if (eventHandler != null)
     {
         eventHandler(this, args);
         return(true);
     }
     return(false);
 }
Пример #2
0
        public override void Start()
        {
            view.ChangeBackground();

            UpdateTopBar();
            EventDispatcher.AddEventListener(EventConst.CreateActivityContenet, CreateActivityContenet);
            EventDispatcher.AddEventListener(EventConst.UpdateUserMoney, UpdateTopBar);
            EventDispatcher.AddEventListener(EventConst.UpdateEnergy, UpdateTopBar);
            EventDispatcher.AddEventListener <RepeatedField <UserBuyRmbMallPB> >(EventConst.GetPayInfoSuccess, arr =>
            {
                UpdateTopBar();
            });

            EventDispatcher.AddEventListener(EventConst.UserLevelUp, OnUserLevelup);
            EventDispatcher.AddEventListener(EventConst.MainLineLevelUpdate, view.HandleFunctionOpen);

            EventDispatcher.AddEventListener(EventConst.OnDataLoadComplete, OnDataLoadComplete);
            EventDispatcher.AddEventListener <int>(EventConst.ActivitySignInClick, OnActivitySignInClick);

            EventDispatcher.AddEventListener <int>(EventConst.LoveDiaryEditSaveAndGoBackMainModule, OnLoveDiaryEditSaveAndGoBackMainModule);
            EventDispatcher.AddEventListener <bool>(EventConst.ChangeTopPower, SetPowerState);

            EventDispatcher.AddEventListener <PlayerVo>(EventConst.UpDataUserName, UpDataUserName);

            EventDispatcher.AddEventListener <bool>(EventConst.CloseFirstRechargeBtn, CloseFirstRechargeBtn);

            EventDispatcher.AddEventListener(EventConst.RefreshActivityImageAndActivityPage, RefreshActivityImageAndActivityPage);
            EventDispatcher.AddEventListener(EventConst.RefreshPoint, SendRedPoint);

            EventDispatcher.AddEventListener(EventConst.UpdateExchangeIntegral, UpdateExchangeIntegral);
            EventDispatcher.AddEventListener(EventConst.ShowStoreScore, OnScoreStore);

            EventDispatcher.AddEventListener(EventConst.OnTriggerGiftChange, OnTriggerGiftChange);

            EventDispatcher.AddEventListener <RepeatedField <long> >(EventConst.TriggerGiftPaySuccess, OnGiftChange);
            // EventDispatcher.AddEventListener(EventConst.ShowConfirmBind,OpenConfirmWindow);
            EventDispatcher.AddEventListener(EventConst.SettingUserInfoUpdate, SetIsAddictionTime);
            EventDispatcher.AddEventListener(EventConst.GetRealNameAward, GetRealNameAward);
            EventDispatcher.AddEventListener(EventConst.UpdateMainViewHeadInfo, UpdateMainViewHeadInfo);
            InitMainLive2d();

            ShowWindow();

            _lastDate          = new DateTime(ClientTimer.Instance.GetCurrentTimeStamp());
            _dailyRefreshtimer = ClientTimer.Instance.AddCountDown("DailyRefresh", long.MaxValue, 5, DailyRefresh, null);
            // CheckAddicationTime();

            OnTriggerGiftChange();
            SetGameLoginHasChange();
            SetIsAddictionTime();
        }
Пример #3
0
        public void SetTimer(float intervalSec, TimerHandler handler, int repeatCount = 0, TimerCompleteHandler completeHandler = null)
        {
            TimerData timerData = NewTimerData(handler);

            if (timerData != null)
            {
                timerData.m_intervalSec  = intervalSec;
                timerData.m_repeatCount  = repeatCount;
                timerData.m_currentCount = 0;
                timerData.m_lastTime     = Time.time;

                timerData.AddHandler(handler, completeHandler);
            }
        }
Пример #4
0
    private void CheckShowItems()
    {
        long nextStartTime = 0;
        TabSelectAnimBtnData data;

        _showItems.Clear();
        long curTime = ClientTimer.Instance.GetCurrentTimeStamp();

        _tabCount = 0;
        foreach (KeyValuePair <string, TabSelectAnimBtnItem> item in _items)
        {
            data = item.Value.data;
            if (data.isAlwayShow)
            {
                _showItems.Add(item.Key);
                _tabCount++;
            }
            else
            {
                if (curTime >= data.startTime && curTime < data.endTime)
                {
                    _showItems.Add(item.Key);
                    _tabCount++;
                    GetTabBtn(item.Key).SetActive(true);
                }
                else
                {
                    GetTabBtn(item.Key).SetActive(false);
                }
            }

            if (data.startTime > 0 && data.startTime > curTime)
            {
                if (nextStartTime == 0 || data.startTime < nextStartTime)
                {
                    nextStartTime = data.startTime;
                }
            }
        }

        if (_countDown != null)
        {
            ClientTimer.Instance.RemoveCountDown(_countDown);
            _countDown = null;
        }
        if (nextStartTime != 0)
        {
            _countDown = ClientTimer.Instance.AddCountDown("TabSelectAnimBtnWidget", nextStartTime, 1, null, OnNextStartTime);
        }
    }
 private void MinuteTimer_Elasped(object sender, ElapsedEventArgs e)
 {
     if (isPaused)
     {
         SetTaskbarTooltip(TimeToPauseEnd() + TOOLTIP_PAUSE_MSG);
         TimerHandler.IncrementCounterTime(ref pauseLengthSoFar, HALF_MINUTE_IN_MS);
     }
     else
     {
         SetTaskbarTooltip(TimeToNextLongBreak() + TOOLTIP_LONG_MSG);
         TimerHandler.IncrementCounterTime(ref shortBreakLengthSoFar, HALF_MINUTE_IN_MS);
         TimerHandler.IncrementCounterTime(ref longBreakLengthSoFar, HALF_MINUTE_IN_MS);
     }
 }
Пример #6
0
    // 添加计时器
    public int AddTimer(int time, TimerHandler callback, bool loop = false)
    {
        TimerInfo info = new TimerInfo();

        info.timerId      = ++_currentTimerId;
        info.startTime    = _currentTime;
        info.delayTime    = time;
        info.handler      = callback;
        info.loop         = loop;
        info.needToRemove = false;

        _allTimerInfos.Add(info);
        return(info.timerId);
    }
Пример #7
0
    /// <summary>
    /// 设置活动时间
    /// </summary>
    private void SetActivityTime()
    {
        var curTimeStamp = ClientTimer.Instance.GetCurrentTimeStamp();
        var surplusDay   = DateUtil.GetSurplusDay(curTimeStamp, _endTimeStamp);

        if (surplusDay != 0)
        {
            _activityTimeTxt.text = I18NManager.Get("ActivityTemplate_ActivityTemplateTime1", surplusDay);
        }
        else
        {
            _countDown = ClientTimer.Instance.AddCountDown("CountDown", Int64.MaxValue, 1f, CountDown, null);
            CountDown(0);
        }
    }
Пример #8
0
        public void OnStart(uint index, int times, float delay, float interval, bool ignoreTimeScale, TimerHandler handler, object parm = null)
        {
            this.index           = index;
            this.times           = times;
            this.delay           = delay;
            this.interval        = interval;
            this.ignoreTimeScale = ignoreTimeScale;
            this.handler         = handler;
            this.parm            = parm;

            this.m_curTimer = 0;
            this.m_inDelay  = true;
            this.m_isPause  = false;
            this.m_isDone   = false;
        }
Пример #9
0
        public static Timer loop(float delay, TimerHandler method)
        {
            if (method == null)
            {
                return(null);
            }
            if (delay <= 0)
            {
                return(null);
            }
            Timer t = new Timer(delay, method, Loops.Infinite);

            timers.Add(t);
            return(t);
        }
Пример #10
0
        public void SetData(List <UserEncourageActVo> vo, SupporterActivityModel supporterActivityModel, int refrhtime,
                            long nexttime = 0)
        {
            _supporterActivityModel = supporterActivityModel;
            _useencourageActVos     = vo;
            _lock = false;
            int notstartactcount = 0;

            for (int i = 0; i < _activityList.childCount; i++)
            {
                if (vo.Count < 1 || vo.Count < i + 1)
                {
                }
                else
                {
                    SetActivityItemData(_activityList.GetChild(i), vo[i]);
                    if (vo[i].StartState == 0)
                    {
                        PointerClickListener.Get(_activityList.GetChild(i).gameObject).parameter = vo[i];
                        PointerClickListener.Get(_activityList.GetChild(i).gameObject).onClick   = GoToFansModule;
                        notstartactcount++;
                    }
                    else
                    {
                        PointerClickListener.Get(_activityList.GetChild(i).gameObject).onClick = null;
                        PointerClickListener.Get(_activityList.GetChild(i).gameObject).onClick = null;
                    }
                }
            }

            refreshCostGoldNum(refrhtime);


            //_costGlod.text = "" + lastcost;

            if (_handle != null)
            {
                ClientTimer.Instance.RemoveCountDown(_handle);
            }

            _handle = ClientTimer.Instance.AddCountDown("UpdateAutoChange", Int64.MaxValue, 1f, UpdateAutoChange, null);
            if (nexttime != 0)
            {
                _supporterActivityModel.NextTime = nexttime;
            }

//            SetSupporterEnergy();
        }
Пример #11
0
        public async void OnGet()
        {
            if (ServiceBusHandler.program != null)
            {
                if (StaticResources.PlayerList.Count() > 0 && StaticResources.gameCompleted == false)
                {
                    MessageSender messageSender = new MessageSender();
                    messageSender.SendLeaveLobbyMessage();
                }

                TimerHandler.ResetHandler();
                await ServiceBusHandler.ResetData();
            }

            StaticResources.ResetData();
        }
    public void SetResidueDay(long endTimeStamp)
    {
        _endTimeStamp = endTimeStamp;
        var curTimeStamp = ClientTimer.Instance.GetCurrentTimeStamp();
        var surplusDay   = DateUtil.GetSurplusDay(curTimeStamp, endTimeStamp);

        if (surplusDay != 0)
        {
            _timeTxt.text = I18NManager.Get("Activity_SevenActivityResidueDays", surplusDay);
        }
        else
        {
            _countDown = ClientTimer.Instance.AddCountDown("CountDown", Int64.MaxValue, 1f, CountDown, null);
            CountDown(0);
        }
    }
Пример #13
0
        /// <summary>
        /// 是否显示防沉迷计时
        /// </summary>
        private void SetIsAddictionTime()
        {
            var addictionTime = GalaAccountManager.Instance.FetchUserCanPlayTime();//还剩多少秒
            var isStar        = addictionTime >= 0;

            if (isStar)
            {
                addictionTime = addictionTime * 1000 + ClientTimer.Instance.GetCurrentTimeStamp();
                Debug.LogError("--------------" + addictionTime);

                if (_addictionTimerHandler == null)
                {
                    _addictionTimerHandler = ClientTimer.Instance.AddCountDown("CountDown", Int64.MaxValue, 1f, (
                                                                                   delegate(int i)
                    {
                        string timeStr = "";
                        var curTimeStamp = ClientTimer.Instance.GetCurrentTimeStamp();
                        long time = addictionTime - curTimeStamp;
                        if (time < 0)
                        {
                            ClientTimer.Instance.RemoveCountDown(_addictionTimerHandler);
                            return;
                        }
                        else
                        {
                            long s = (time / 1000) % 60;
                            long m = (time / (60 * 1000)) % 60;
                            long h = time / (60 * 60 * 1000);
                            timeStr = $"{h:D2}:{m:D2}:{s:D2}";
                        }

                        view.SetCountDownTime(true, timeStr);
                    }), null);
                }
            }
            else
            {
                if (_addictionTimerHandler != null)
                {
                    ClientTimer.Instance.RemoveCountDown(_addictionTimerHandler);
                }

                view.SetCountDownTime(false, "");
                //隐藏防沉迷计时Image
            }
        }
Пример #14
0
        /// <summary>
        /// Called when starting the scene
        /// </summary>
        public override void OnStart()
        {
            Current            = this;
            TriangleRenderPass = new BasicRenderPass(Graphics);
            ClearEffect        = new ClearEffect(Graphics, TriangleRenderPass);
            ClearEffect.Start();
            ClearEffect.ClearColor = new ClearColorValue(0.5f, 0.7f, 0.9f);
            TimerHandler           = new TimerHandler(this);
            PlayerHandler          = new PlayerInterfaceHandler(1);
            BulletHandler          = new BulletHandler(this, 200000, ClearEffect);
            BulletHandler.Start();
            EnemyHandler = new EnemyHandler(this, 10000, BulletHandler.SpriteEffect);
            EnemyHandler.Start();

            ScriptHandler.ExecuteFile("demo.nut");
            ScriptHandler.CallGlobal("main");
        }
        private void HandleGameOver(int playerId, IPlayerField field = null)
        {
            var player = StaticResources.PlayerList.FirstOrDefault(Speler => Speler.PlayerId == playerId);

            string logEntry = "All boats of {player} have been destroyed";

            logEntry = logEntry.Replace("{player}", player.name);
            WriteMessageToLog(logEntry);

            player.GameOver = true;

            CheckforHighscoreUpdate(player);

            if (field != null)
            {
                // display all boats in field as sunk
                // store all ship coordinates as GameResponse hit = true

                foreach (var boat in field.boats)
                {
                    foreach (var coordinate in boat.coordinates)
                    {
                        ShotLog shotLog = new ShotLog()
                        {
                            coordinate = coordinate,
                            hit        = true
                        };

                        StaticResources.log.shotLog.Add(shotLog);
                    }
                }
            }

            int count = StaticResources.PlayerList.Where(p => p.GameOver == false).Count();

            if (count == 1)
            {
                TimerHandler.ResetHandler();
                player = StaticResources.PlayerList.FirstOrDefault(Speler => Speler.GameOver == false);
                StaticResources.log.winner = player.name;

                string message = player.name + " has won the game";
                WriteMessageToLog(message);
                CheckforHighscoreUpdate(player);
            }
        }
Пример #16
0
    private void SetActivityTime()
    {
        var curTimeStamp = ClientTimer.Instance.GetCurrentTimeStamp();
        var surplusDay   = DateUtil.GetSurplusDay(curTimeStamp, _endTimeStamp);

        if (surplusDay != 0)
        {
            _leftTime.text = I18NManager.Get("Activity_SevenActivityResidueDays", surplusDay);
        }
        else
        {
            if (_countDown == null)
            {
                _countDown = ClientTimer.Instance.AddCountDown("CountDown", Int64.MaxValue, 1f, CountDown, null);
                CountDown(0);
            }
        }
    }
Пример #17
0
    public void init()
    {
        //  time intervals;
        timeInterval = new int[] { 5000, 1000 };
        timerNum     = timeInterval.Length;


        timers = new TimerHandler[timerNum];
        for (int i = 0; i < timerNum; i++)
        {
            timers[i] = new TimerHandler();
        }

        foreach (TimerHandler timer in timers)
        {
            timer.AddListener(this);
        }
    }
Пример #18
0
    private object create(bool useFrame, bool repeat, bool cover, int delay, Delegate method, params object[] args)
    {
        if (method == null)
        {
            return(null);
        }

        //如果执行时间小于1,直接执行
        if (delay < 1)
        {
            method.DynamicInvoke(args);
            return(-1);
        }
        TimerHandler handler;
        TimerHandler coverHandler = _handlers.Find(han => han.method == method);

        if (cover && coverHandler != null)
        {
            handler = coverHandler;
            _handlers.Remove(coverHandler);
        }
        else
        {
            if (_pool.Count > 0)
            {
                handler = _pool[_pool.Count - 1];
                _pool.Remove(handler);
            }
            else
            {
                handler = new TimerHandler();
            }
        }

        handler.userFrame = useFrame;
        handler.repeat    = repeat;
        handler.delay     = delay;
        handler.method    = method;
        handler.args      = args;
        handler.exeTime   = delay + (useFrame ? _currFrame : currentTime);
        _handlers.Add(handler);
        return(method);
    }
 //Quand on reçoit des données du serveur
 private void RemoteServer_DataReceived(Client client, object data)
 {
     //Si c'est du texte, à ce niveau, c'est soir le serveur qui dit qu'on peut start la game ou un que l'adversaire a perdu
     if (data is String)
     {
         if ((String)data == "start")
         {
             TimerHandler p = new TimerHandler(startGameGridMe);
             this.Invoke(p);
         }
         else if ((String)data == "gameOver")
         {
             RivalGameOverHandler p = new RivalGameOverHandler(StopGameGridMe);
             this.Invoke(p);
         }
     }
     else if (data is ChatMessage)//Si c'est un chat message, on l'affiche dans le chat
     {
         if (((ChatMessage)data).strMessage != "")
         {
             String strMessage     = ((ChatMessage)data).strMessage;
             PrintMessageHandler p = new PrintMessageHandler(printMessageChat);
             this.Invoke(p, txtBoxChat, strMessage);
         }
     }
     else if (data is TetrisClientInfo) //Si c'est un client info, on rafraichit la grid de l'adversaire. On utilise un TetriClientInfo parce qu'on ne peut pas sérialiser les données graphiques comme les picrutebox
     {
         TetrisClientInfo info = (TetrisClientInfo)data;
         int rows = gridPlayerRival.numLines;
         int cols = gridPlayerRival.numCols;
         for (int i = 0; i < rows; i++)
         {
             for (int j = 0; j < cols; j++)
             {//Copie des couleurs de la grid de l'adversaire
                 gridPlayerRival.pictBox_Case[i, j].BackColor = info.tbColors[i, j];
             }
         }
         //Ragrichissement du score
         gridPlayerRival.score = info.score;
         onScoreChanged(gridPlayerRival, EventArgs.Empty);
     }
 }
Пример #20
0
    public TimerHandler AddCountDown(string name, long finish, float interval, Action <int> stepCallback, Action finishCallback)
    {
        if (finish < GetCurrentTimeStamp())
        {
            return(null);
        }

        var action = new TimerHandler(name, finish, interval, stepCallback, finishCallback);

        TimerHandler timer = GetTimer(name);

        if (timer != null)
        {
            timers.Remove(timer);
        }

        timers.Add(action);

        return(action);
    }
Пример #21
0
        public DispatchTimer(long delay, DispatchQueue queue, TimerHandler block)
        {
            this.timerBlock = block;
            this.queue      = queue;
            this.delay      = delay;
            this.source     = new DispatchSource.Timer(queue);

            base.Init();

            Action wrapper = () =>
            {
                if (!source.IsCanceled)
                {
                    source.Cancel();
                    timerBlock(this);
                }
            };

            wrappedBlock = wrapper;
        }
Пример #22
0
        void DeleteTimerData(TimerHandler handler)
        {
            if (m_dicTimer.ContainsKey(handler))
            {
                m_timerDataPool.Enqueue(m_dicTimer[handler]);
                m_dicTimer[handler].Clear();

                m_dicTimer.Remove(handler);
                m_bListChanged = true;

                if (m_dicTimer.Count == 0)
                {
                    m_isRunning = false;
                }
            }
            //else
            //{
            //    Debugger.Log("RemoveTimer Fail!!! TimerHandler not in Timer List");
            //}
        }
Пример #23
0
        public TimerEntry(float interval, int repeat, bool startImmediately, TimerHandler timerCallback, CompleteHandler completCallback, object param = null)
        {
            this._interval        = interval;
            this._repeat          = repeat;
            this.timerCallback    = timerCallback;
            this._completCallback = completCallback;
            this._param           = param;
            if (startImmediately)
            {
                this.timerCallback?.Invoke(this._count, 0, this._param);

                ++this._count;

                if (this._repeat > 0 && this._count == this._repeat)
                {
                    this.finished = true;
                    this._completCallback?.Invoke();
                }
            }
        }
Пример #24
0
 void advanceTime()
 {
     m_CurrFrame++;
     for (int i = 0; i < m_Handlers.Count; i++)
     {
         TimerHandler handler = m_Handlers[i];
         long         t       = handler.userFrame ? m_CurrFrame : currentTime;
         if (t >= handler.exeTime)
         {
             Delegate method = handler.method;
             object[] args   = handler.args;
             if (handler.repeat)
             {
                 while (t >= handler.exeTime)
                 {
                     handler.exeTime += handler.delay;
                     if (args.Length == 0)
                     {
                         ((Handler)method)();
                     }
                     else
                     {
                         method.DynamicInvoke(args);
                     }
                 }
             }
             else
             {
                 clear(handler.method);
                 if (args.Length == 0)
                 {
                     ((Handler)method)();
                 }
                 else
                 {
                     method.DynamicInvoke(args);
                 }
             }
         }
     }
 }
Пример #25
0
        public void Add(TimerHandler timeHandler, int delay, int count)
        {
            TimerInfo info = null;

            if (timerDict.TryGetValue(timeHandler, out info) == false)
            {
                info               = new TimerInfo();
                info.count         = count;
                info.OnEventHander = timeHandler;
                info.delay         = delay;
                info.lastTimer     = Time.realtimeSinceStartup * 1000;
                timerDict.Add(timeHandler, info);
                //    log.Debug("Add TimerHandler : " + timeHandler + " delay : " + delay + " count : " + count);
            }
            else
            {
                info.delay = delay;
                info.count = count;
                //    log.Debug("Update TimerHandler : " + info.OnEventHander + " delay : " + delay + " count : " + count);
            }
        }
        /// <summary>
        /// Pauses the short and long timers if timed pause.
        /// Short, long and minute timers if not timed pause.
        /// </summary>
        private void PauseTimers(bool isTimed)
        {
            if (isTimed)
            {
                List <Timer> timersToStop = new List <Timer>()
                {
                    shortIntervalTimer, longIntervalTimer
                };
                TimerHandler.StopTimers(ref timersToStop);

                TimerHandler.RestartTimer(ref pauseTimer, pauseTotalLength.TotalMilliseconds);
            }
            else
            {
                List <Timer> timersToStop = new List <Timer>()
                {
                    shortIntervalTimer, longIntervalTimer, minuteTimer
                };
                TimerHandler.StopTimers(ref timersToStop);
            }
        }
Пример #27
0
        /// <summary>
        /// 注册计时事件;
        /// </summary>
        /// <param name="delayTime">第一次执行延时(s)</param>
        /// <param name="repeatTimes">重复执行次数(s)</param>
        /// <param name="intervalTime">两次执行间隔时间(s)</param>
        /// <param name="callBackFunc">无参回调函数</param>
        /// <param name="callBackFuncWithParam">回调函数</param>
        /// <param name="param">参数</param>
        /// <param name="onFinish">事件结束回调函数</param>
        /// <returns></returns>
        public TimerHandler RegisterTimerEvent(float delayTime, int repeatTimes, float intervalTime, Action callBackFunc,
                                               Action <object> callBackFuncWithParam, object param, Action onFinish)
        {
            TimerEvent timerEvent = new TimerEvent
            {
                DelayTime             = delayTime,
                RepeatTimes           = repeatTimes,
                IntervalTime          = intervalTime,
                CallBackFunc          = callBackFunc,
                CallBackFuncWithParam = callBackFuncWithParam,
                Param    = param,
                OnFinish = onFinish,
                IsFinish = false,
                IsPause  = false
            };

            timerEvent.InitTimerEvent();
            EventLists.Add(timerEvent);
            TimerHandler handler = new TimerHandler(timerEvent);

            return(handler);
        }
        public GaganController(Context context)
        {
            Context      = context;
            Pref         = GaganPreference.Load(context);
            BcoreManager = new BcoreManager(Context);
            BcoreManager.BcoreConnectionChanged += (s, e) =>
            {
                if (e.IsConnected)
                {
                    IsTimerRunning = false;
                    TimerHandler   = new Handler(Looper.MainLooper);
                }
                else
                {
                    IsTimerRunning = false;
                    TimerHandler?.RemoveCallbacks(OnTimer);
                    TimerHandler = null;
                }

                BcoreConnectionChanged?.Invoke(this, e.IsConnected);
            };
        }
        private void PauseItem_Click(object sender, RoutedEventArgs e)
        {
            if (pauseWindow == null)
            {
                pauseWindow         = new PauseWindow();
                pauseWindow.Closed += PauseWindow_Closed;
            }
            else
            {
                pauseWindow.Activate();
            }

            pauseTotalLength = TimeSpan.FromMinutes(pauseWindow.ShowDialog());

            isPaused = true;

            // If the user chose timed pause
            if (pauseTotalLength.TotalSeconds > 0)
            {
                // Zero out the counter to know how long the pause should be going on
                TimerHandler.ResetCounterTime(ref pauseLengthSoFar);

                ActivateResumeBtn();
                SetTaskbarTooltip(TimeToPauseEnd() + TOOLTIP_PAUSE_MSG);
                PauseTimers(true);
            }
            // if this is going on till resume is pushed
            else if (pauseTotalLength.TotalMinutes.Equals(TimeSpan.FromMinutes(-1)))
            {
                ActivateResumeBtn();
                SetTaskbarTooltip(TOOLTIP_INDEF_PAUSE);
                PauseTimers(false);
            }
            // Or the user just canceled
            else
            {
                isPaused = false;
            }
        }
Пример #30
0
 public void OnLoadComplete(/* final */ Scene pScene)
 {
     /* TODO Unload texture from loading-screen. */
     if (this.mEngineOptions.HasLoadingScreen())
     {
         /*
          * this.registerUpdateHandler(new TimerHandler(LOADING_SCREEN_DURATION_DEFAULT, new ITimerCallback() {
          *  //@Override
          *  public override void onTimePassed(/* final * / TimerHandler pTimerHandler) {
          *      Engine.this.unregisterUpdateHandler(pTimerHandler);
          *      Engine.this.setScene(pScene);
          *  }
          * }));
          */
         IUpdateHandler EngineTimerUpdateHandler = new TimerHandler(LOADING_SCREEN_DURATION_DEFAULT,
                                                                    new EngineTimer(this));
         this.RegisterUpdateHandler(EngineTimerUpdateHandler);
     }
     else
     {
         this.SetScene(pScene);
     }
 }
Пример #31
0
 public MyTimer(TimerHandler handler)
 {
     timer = new Timer();
     timer.Tick += new EventHandler(Tick);
     this.handler = handler;
 }
Пример #32
0
 public abstract int RegisterHandler(TimerHandler handler, long TimeoutNS, bool Recurring, FOS_System.Object state);