Exemple #1
0
    public new T Pop()
    {
        T item = base.Pop();

        OnPush?.Invoke();
        return(item);
    }
Exemple #2
0
    public void GetRepulsed(Vector3 force, ForceMode forceMode = ForceMode.VelocityChange)
    {
        if (!IsActive)
        {
            return;
        }

        OnPush?.Invoke(force);

        switch (forceMode)
        {
        case ForceMode.Acceleration:
            _rb.AddForce(force, ForceMode.Acceleration);
            break;

        case ForceMode.VelocityChange:
            _rb.AddForce(force, ForceMode.VelocityChange);
            break;

        case ForceMode.Impulse:
            _rb.AddForce(force, ForceMode.Impulse);
            break;

        case ForceMode.Force:
            _rb.AddForce(force, ForceMode.Force);
            break;
        }
    }
        private void TxtInStock_ButtonClick(object sender, EventArgs e)
        {
            try
            {
                if (this._product == null)
                {
                    return;
                }

                if (int.TryParse(this.txtInStock.Text, out int inStock))
                {
                    // Validar cantidad
                    if (inStock <= 0)
                    {
                        throw new Exception("La cantidad debe ser mayor a cero.");
                    }

                    // Validar cantidad disponible.
                    if (this.Filter.WarehouseID != null && inStock > this._product.AvailableQuantity)
                    {
                        throw new Exception("La cantidad no puede ser mayor a la cantidad disponible del producto");
                    }

                    this.txtInStock.Clear();
                    OnPush?.Invoke(inStock, this._product);
                }
            }
            catch (Exception ex)
            {
                ex.ShowDialog(MessageBoxIcon.Warning);
            }
        }
Exemple #4
0
 // Pool an item
 public void Push(T obj)
 {
     if (obj == null)
     {
         return;
     }
     OnPush?.Invoke(obj);
     _pool.Push(obj);
 }
Exemple #5
0
 public bool enPool(T obj)
 {
     if (obj != null)
     {
         OnPush.Invoke(obj);
         avaliableItems.Enqueue(obj);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #6
0
        public override async Task <PushResponse> Push(
            IAsyncStreamReader <Rumor> requestStream,
            ServerCallContext context)
        {
            var rumors = new List <Rumor>();

            while (!context.CancellationToken.IsCancellationRequested &&
                   await requestStream.MoveNext(context.CancellationToken))
            {
                var rumor = requestStream.Current;
                rumors.Add(rumor);
            }

            OnPush?.Invoke(this, new PushRumorEventArgs
            {
                Rumors = rumors,
            });

            return(new PushResponse());
        }
Exemple #7
0
        private bool Populate(T blueprint, int count, Transform transform = null)
        {
            parent = this.parent;
            T startObj = CreateObject(blueprint);

            if (startObj == null)
            {
                throw new Exception();
            }

            avaliableItems.Enqueue(startObj);
            OnPush.Invoke(startObj);

            for (int i = 1; i < count; i++)
            {
                startObj = CreateObject(blueprint);
                avaliableItems.Enqueue(startObj);
                OnPush.Invoke(startObj);
            }
            return(true);
        }
Exemple #8
0
        public override void DidPush()
        {
            if (OnPush != null)
            {
                OnPush.Invoke();
            }

            if (m_components != null)
            {
                foreach (var c in m_components)
                {
                    c.DidPush(this.m_dataObject);
                }
            }

            //Populate();

            //DidShow();

            //base.DidPush();
        }
Exemple #9
0
 public new void Push(T item)
 {
     OnPush?.Invoke(item);
     base.Push(item);
 }
Exemple #10
0
    public new void Push(T item)
    {
        base.Push(item);

        OnPush?.Invoke();
    }
Exemple #11
0
 protected virtual void OnPushEvent(WebhookEventArgs e)
 {
     OnPush?.Invoke(this, e);
 }
Exemple #12
0
 public void Push(PointF direction, PointF?source) => OnPush?.Invoke(direction, source);
Exemple #13
0
 public virtual void Push(T item)
 {
     stack.Push(item);
     OnPush?.Invoke(item);
 }