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();
 }
Ejemplo n.º 3
0
 public void IntervalSignal(IScheduled <object?> scheduled, object?data)
 {
     if (!executed.Get() && !TimedOut.Get())
     {
         TimedOut.Set(true);
         Parent?.TimedOut.Set(true);
         HasFailedValue.Set(true);
     }
 }
Ejemplo n.º 4
0
        internal override void InnerInvoke(BasicCompletes completedCompletes)
        {
            if (TimedOut.Get() || executed.Get())
            {
                return;
            }

            base.InnerInvoke(completedCompletes);
            executed.Set(true);
        }
Ejemplo n.º 5
0
        internal override bool InnerInvoke(BasicCompletes completedCompletes)
        {
            if (TimedOut.Get() || _executed.Get())
            {
                return(false);
            }

            base.InnerInvoke(completedCompletes);
            _executed.Set(true);
            return(true);
        }
        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.º 7
0
        private void HandleElapsed(ITransient sender)
        {
            if (!Active)
            {
                return;
            }

            TimedOut?.Invoke(this);

            HasTimedOut = true;

            Complete();
        }
Ejemplo n.º 8
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.º 9
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked {
         var result = Success.GetHashCode();
         result = (result * 397) ^ Error.GetHashCode();
         result = (result * 397) ^ NumPods;
         result = (result * 397) ^ (DataTypes != null ? DataTypes.GetHashCode() : 0);
         result = (result * 397) ^ (TimedOut != null ? TimedOut.GetHashCode() : 0);
         result = (result * 397) ^ Timing.GetHashCode();
         result = (result * 397) ^ ParseTiming.GetHashCode();
         result = (result * 397) ^ ParseTimedOut.GetHashCode();
         result = (result * 397) ^ (Recalculate != null ? Recalculate.GetHashCode() : 0);
         result = (result * 397) ^ (Version != null ? Version.GetHashCode() : 0);
         result = (result * 397) ^ (Pods != null ? Pods.GetHashCode() : 0);
         return(result);
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var result = Success.GetHashCode();
         result = (result * 397) ^ Error.GetHashCode();
         result = (result * 397) ^ NumPods;
         result = (result * 397) ^ (!DataTypes.IsNull() ? DataTypes.GetHashCode() : 0);
         result = (result * 397) ^ (!TimedOut.IsNull() ? TimedOut.GetHashCode() : 0);
         result = (result * 397) ^ Timing.GetHashCode();
         result = (result * 397) ^ ParseTiming.GetHashCode();
         result = (result * 397) ^ ParseTimedOut.GetHashCode();
         result = (result * 397) ^ (!Recalculate.IsNull() ? Recalculate.GetHashCode() : 0);
         result = (result * 397) ^ (!Version.IsNull() ? Version.GetHashCode() : 0);
         result = (result * 397) ^ (!Pods.IsNull() ? Pods.GetHashCode() : 0);
         return(result);
     }
 }
Ejemplo n.º 11
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));
        }
Ejemplo n.º 12
0
        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.º 14
0
 private void IntervalElapsed(object sender, ElapsedEventArgs e)
 {
     Unsubscribe();
     TimedOut?.Invoke();
 }
Ejemplo n.º 15
0
 private void TimedOutHandler(object sender, EventArgs e)
 {
     Console.WriteLine("[ProgressbarPopupRenderer.TimedOutHandler] 0");
     TimedOut?.Invoke(this, EventArgs.Empty);
     _popUp.Dismiss();
 }
Ejemplo n.º 16
0
 private void StopByTime()
 {
     TimedOut?.Invoke();
     Unsubscribe();
 }
Ejemplo n.º 17
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);
 }