示例#1
0
        public Task PushAsync(PopupPage page, bool animate = true)
        {
            lock (_locker)
            {
                if (_popupStack.Contains(page))
                {
                    return(Task.CompletedTask);
                }

                _popupStack.Add(page);

                var task = InvokeThreadSafe(async() =>
                {
                    animate = CanBeAnimated(animate);

                    if (animate)
                    {
                        page.PreparingAnimation();
                        await AddAsync(page);
                        await page.AppearingAnimation();
                    }
                    else
                    {
                        await AddAsync(page);
                    }

                    page.AppearingTransactionTask = null;
                });
                page.AppearingTransactionTask = task;
                Pushed?.Invoke(this, new NavigationEventArgs(page));
                return(task);
            }
        }
示例#2
0
        async Task PushAsyncInner(Page page, bool animated)
        {
            if (InternalChildren.Contains(page))
            {
                return;
            }

            PushPage(page);

            var args = new NavigationRequestedEventArgs(page, animated);

            EventHandler <NavigationRequestedEventArgs> requestPush = PushRequested;

            if (requestPush != null)
            {
                requestPush(this, args);

                if (args.Task != null)
                {
                    await args.Task;
                }
            }

            Pushed?.Invoke(this, args);
        }
示例#3
0
 /// <inheritdoc/>
 public Task PushAsync(PopupPage page, bool animate = true)
 {
     Pushing?.Invoke(this, new PopupNavigationEventArgs(page, animate));
     _stack.Push(page);
     Pushed?.Invoke(this, new PopupNavigationEventArgs(page, animate));
     return(Task.CompletedTask);
 }
 private void Enc0Falling(object sender, PinValueChangedEventArgs pinValueChangedEventArgs)
 {
     Enc0Deboucer.Debouce(() => {
         Pushed?.Invoke(this, new EventArgs());
         //Console.WriteLine("ENC0 push");
     });
 }
示例#5
0
 public void OnPushed(Unit emeny)
 {
     _rigidbody.isKinematic = false;
     _enemy = emeny;
     Pushed?.Invoke();
     StartCoroutine(OnStandUpDelay());
 }
示例#6
0
 private void repeatTimer_Tick(object sender, EventArgs e)
 {
     if (Pushed != null && pressed)
     {
         Pushed.Invoke(this, new EventArgs());
     }
     repeatTimer.Interval = 150;
     repeatTimer.Enabled  = true;
 }
示例#7
0
    protected virtual void OnPushed()
    {
        Pushed?.Invoke();
        var currentTile = LayerManager.Instance.CurrentLayer?.GetTileAtPosition(CurrentPosition);

        if (currentTile == null)
        {
            OnEmptyPlaceReached();
        }
    }
示例#8
0
 private void ArrowButton_MouseDown(object sender, MouseEventArgs e)
 {
     pressed = true;
     if (Pushed != null)
     {
         Pushed.Invoke(this, new EventArgs());
     }
     repeatTimer.Interval = 400;
     repeatTimer.Enabled  = true;
     Refresh();
 }
示例#9
0
        public void Enqueue(T value)
        {
            var node     = new Node <T>(value);
            var prevNode = _tail;

            _tail = node;
            if (Count == 0)
            {
                _head = _tail;
            }
            else
            {
                prevNode.NextNode = _tail;
            }
            Count++;
            Pushed?.Invoke(this, new PushToQueueEventArgs <T>(value, $"{value} pushed"));
        }
        async Task SendHandlerUpdateAsync(bool animated, bool push = false, bool pop = false, bool popToRoot = false)
        {
            // Wait for any pending navigation tasks to finish
            await WaitForCurrentNavigationTask();

            var completionSource = new TaskCompletionSource <object>();

            CurrentNavigationTask = completionSource.Task;
            _taskCompletionSource = completionSource;

            // We create a new list to send to the handler because the structure backing
            // The Navigation stack isn't immutable
            var previousPage             = CurrentPage;
            var immutableNavigationStack = new List <IView>(NavigationStack);

            // Alert currently visible pages that navigation is happening
            SendNavigating();

            // Create the request for the handler
            var request = new NavigationRequest(immutableNavigationStack, animated);

            ((INavigationView)this).RequestNavigation(request);

            // Wait for the handler to finish processing the navigation
            await completionSource.Task;

            // Send navigated event to currently visible pages and associated navigation event
            SendNavigated(previousPage);
            if (push)
            {
                Pushed?.Invoke(this, new NavigationEventArgs(CurrentPage));
            }
            else if (pop)
            {
                Popped?.Invoke(this, new NavigationEventArgs(previousPage));
            }
            else
            {
                PoppedToRoot?.Invoke(this, new NavigationEventArgs(previousPage));
            }
        }
示例#11
0
        private void PushActivity(Cursor cursor)
        {
            if (cursor.PrimaryPush)
            {
                float worldX = cursor.GetWorldX(managers);
                float worldY = cursor.GetWorldY(managers);

                var sideOver = GetSideOver(
                    worldX,
                    worldY);


                mSideGrabbed = sideOver;

                if (mSideGrabbed != ResizeSide.None)
                {
                    Pushed?.Invoke(this, null);
                    StartRegionChanged?.Invoke(this, null);
                }
            }
        }
        public Task PushAsync(PopupPage page, bool animate = true)
        {
            lock (_locker)
            {
                if (_popupStack.Contains(page))
                {
                    return(Task.CompletedTask);
                    //throw new InvalidOperationException("The page has been pushed already. Pop or remove the page before to push it again");
                }

                Pushing?.Invoke(this, new PopupNavigationEventArgs(page, animate));

                _popupStack.Add(page);

                var task = InvokeThreadSafe(async() =>
                {
                    animate = CanBeAnimated(animate);

                    if (animate)
                    {
                        page.PreparingAnimation();
                        await AddAsync(page);
                        await page.AppearingAnimation();
                    }
                    else
                    {
                        await AddAsync(page);
                    }

                    page.AppearingTransactionTask = null;

                    Pushed?.Invoke(this, new PopupNavigationEventArgs(page, animate));
                });

                page.AppearingTransactionTask = task;

                return(task);
            }
        }
示例#13
0
 public new T Push(T item)
 {
     base.Push(item);
     Pushed?.Invoke(item, EventArgs.Empty);
     return(item);
 }
 private void RaisePushed(IEnumerable <string> changes)
 {
     Pushed?.Invoke(this, new DataEventArgs <IEnumerable <string> >(changes));
 }
示例#15
0
 public IDisposable Push(T item)
 {
     _stack.Push(item);
     Pushed?.Invoke(item);
     return(this);
 }
示例#16
0
 public override void OnPush(MachineId machineId, string currentStateName, string newStateName)
 {
     base.OnPush(machineId, currentStateName, newStateName);
     Pushed?.Invoke(machineId, currentStateName, newStateName);
 }
示例#17
0
 public void Push(string message)
 {
     Pushed?.Invoke(this, message);
 }
示例#18
0
 public void BackgroundPush()
 {
     Pushed?.Invoke();
 }