Ejemplo n.º 1
0
        /// <summary>
        /// Creates and initializes a new instance of the Popup class.
        /// </summary>
        /// <param name="parent">The EvasObject to which the new Popup will be attached as a child.</param>
        /// <since_tizen> preview </since_tizen>
        public Popup(EvasObject parent) : base(parent)
        {
            _dismissed     = new SmartEvent(this, "dismissed");
            _dismissed.On += (sender, e) =>
            {
                Dismissed?.Invoke(this, EventArgs.Empty);
            };

            _blockClicked     = new SmartEvent(this, "block,clicked");
            _blockClicked.On += (sender, e) =>
            {
                OutsideClicked?.Invoke(this, EventArgs.Empty);
            };

            _timeout     = new SmartEvent(this, "timeout");
            _timeout.On += (sender, e) =>
            {
                TimedOut?.Invoke(this, EventArgs.Empty);
            };

            _showFinished     = new SmartEvent(this, "show,finished");
            _showFinished.On += (sender, e) =>
            {
                ShowAnimationFinished?.Invoke(this, EventArgs.Empty);
            };
        }
Ejemplo n.º 2
0
 private void Elapsed(ITransient tr)
 {
     Timer.Elapsed -= Elapsed;
     HasTimedOut    = true;
     TimedOut?.Invoke(this);
     Complete();
 }
        public void Update(GameTime time)
        {
            _timeout -= time.ElapsedGameTime.TotalSeconds;
            if (_timeout < 30)
            {
                if (_warnCount == 0)
                {
                    _warnCount++;
                    _beep.Play();
                }
            }
            if (_timeout < 15)
            {
                if (_warnCount == 1)
                {
                    _warnCount++;
                    _beep.Play();
                }
            }
            if (_timeout <= 11)
            {
                _warnTime += time.ElapsedGameTime.TotalSeconds;
                if (_warnTime >= ((_timeout < 5) ? 0.5 : 1))
                {
                    _warnTime = 0;
                    _beep.Play();
                }
            }

            if (_secondCounter >= 1)
            {
                _secondCounter = 0;
                switch (_tickTock)
                {
                case 0:
                    _tick.Play();
                    _tickTock = 1;
                    break;

                case 1:
                    _tock.Play();
                    _tickTock = 0;
                    break;
                }
            }
            _secondCounter += time.ElapsedGameTime.TotalSeconds;

            if (_timeout <= 0)
            {
                _plexgate.GetLayer(LayerType.Foreground).RemoveEntity(this);
                TimedOut?.Invoke();
            }
        }
Ejemplo n.º 4
0
        private void HandleElapsed(ITransient sender)
        {
            if (!Active)
            {
                return;
            }

            TimedOut?.Invoke(this);

            HasTimedOut = true;

            Complete();
        }
Ejemplo n.º 5
0
        public TimedBarrier(IKernel kernel, TimeSpan span, IEnumerable <ITransient> contents)
        {
            Timer          = kernel.Factory.OneShotTimer(span);
            Timer.Elapsed += (tr) =>
            {
                HasTimedOut = true;
                TimedOut?.Invoke(this);
                Complete();
            };

            foreach (var tr in contents)
            {
                Add(tr);
            }
        }
Ejemplo n.º 6
0
        // Constructor
        public GraphicPopUp()
        {
            _popUp = DependencyService.Get <IGraphicPopup>(DependencyFetchTarget.NewInstance);
            if (_popUp == null)
            {
                throw new Exception("Object reference not set to an instance of a Popup.");
            }

            _popUp.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            _popUp.TimedOut += (s, e) =>
            {
                TimedOut?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(TextProperty, new Binding(nameof(Text), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(DurationProperty, new Binding(nameof(Duration), mode: BindingMode.OneWayToSource, source: _popUp));
        }
        protected override IntPtr CreateHandle(EvasObject parent)
        {
            _popup = new Popup(parent);

            _popup.Dismissed += (s, e) =>
            {
                OnDismissed();
                Dismissed?.Invoke(s, e);
            };
            _popup.OutsideClicked += (s, e) =>
            {
                OutsideClicked?.Invoke(s, e);
            };
            _popup.TimedOut += (s, e) =>
            {
                TimedOut?.Invoke(s, e);
            };
            _popup.ShowAnimationFinished += (s, e) =>
            {
                ShowAnimationFinished?.Invoke(s, e);
            };

            return(_popup);
        }
 private void TimedOutHandler(object sender, EventArgs e)
 {
     Console.WriteLine("[GraphicPopUpRenderer.TimedOutHandler] ");
     TimedOut?.Invoke(this, EventArgs.Empty);
     _popUp.Dismiss();
 }
Ejemplo n.º 9
0
 private void TimedOutHandler(object sender, EventArgs e)
 {
     Console.WriteLine("[ProgressbarPopupRenderer.TimedOutHandler] 0");
     TimedOut?.Invoke(this, EventArgs.Empty);
     _popUp.Dismiss();
 }
Ejemplo n.º 10
0
 private void StopByTime()
 {
     TimedOut?.Invoke();
     Unsubscribe();
 }
Ejemplo n.º 11
0
 ///<summary>Signals that the configured timeout fired while
 ///waiting for an RPC reply.</summary>
 ///<remarks>
 /// Fires the TimedOut event.
 ///</remarks>
 public virtual void OnTimedOut()
 {
     TimedOut?.Invoke(this, null);
 }
Ejemplo n.º 12
0
 private void IntervalElapsed(object sender, ElapsedEventArgs e)
 {
     Unsubscribe();
     TimedOut?.Invoke();
 }