void btnCancel_Click(object sender, EventArgs e)
 {
     if (OnCancel != null)
     {
         OnCancel.Invoke();
     }
 }
Beispiel #2
0
 public void OnPreviousPanelNavigation()
 {
     if (OnCancel != null)
     {
         OnCancel.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #3
0
        public Reservation Set(long time, OnTime onTime, OnCancel onCancel = null,
                               Reservation.IHandle handler = null, IAlarmPayload payload = null)
        {
            Dev.Assert(onTime != null, "Cannot set timer with null onTime delegate");

            if (handler?.Reservation != null)
            {
                return(null);
            }

            Reservation reservation = _reservationPool.Alloc();

            reservation.Time     = LogicTime.TIME() + time;
            reservation.OnTime   = onTime;
            reservation.OnCancel = onCancel;
            reservation.Handler  = handler;
            reservation.Payload  = payload;

            if (handler != null)
            {
                Dev.Assert(handler.Reservation == null, "Alarm reservation already used");
                reservation.Handler.Reservation = reservation;
            }

            _reservations.Add(reservation.Time, reservation);

            return(reservation);
        }
 private void Form_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         OnCancel?.Invoke(this, new EventArgs());
     }
 }
Beispiel #5
0
        private void SetContextMenu(bool isShutDownInProgress)
        {
            var cm = new ContextMenu();

            var openMi = new MenuItem();

            openMi.Text   = "Open";
            openMi.Click += (s, e) => { OnOpen?.Invoke(); };
            cm.MenuItems.Add(openMi);

            if (isShutDownInProgress)
            {
                var cancelMi = new MenuItem();
                cancelMi.Text   = "Cancel delayed operation";
                cancelMi.Click += (s, e) => { OnCancel?.Invoke(); };
                cm.MenuItems.Add(1, cancelMi);
            }

            var closeMi = new MenuItem();

            closeMi.Text   = "Exit";
            closeMi.Click += (s, e) => { OnExit?.Invoke(); };
            cm.MenuItems.Add(closeMi);

            if (_ni.ContextMenu != null)
            {
                _ni.ContextMenu.Dispose();
            }
            _ni.ContextMenu = cm;
        }
Beispiel #6
0
 public void TradeCancel(Character target)
 {
     if (OnCancel != null)
     {
         OnCancel.Invoke(target);
     }
 }
    public static bool ShowLoadDialog(OnSuccess onSuccess, OnCancel onCancel,
                                      bool folderMode = false, string initialPath     = null,
                                      string title    = "Load", string loadButtonText = "Select")
    {
        if (instance.gameObject.activeSelf)
        {
            Debug.LogError("Error: Multiple dialogs are not allowed!");
            return(false);
        }

        if ((initialPath == null || !Directory.Exists(initialPath)) && instance.m_currentPath.Length == 0)
        {
            initialPath = instance.DEFAULT_PATH;
        }

        instance.onSuccess = onSuccess;
        instance.onCancel  = onCancel;

        instance.FolderSelectMode = folderMode;
        instance.Title            = title;
        instance.SubmitButtonText = loadButtonText;

        instance.AcceptNonExistingFilename = false;

        instance.Show();
        instance.CurrentPath = initialPath;

        return(true);
    }
Beispiel #8
0
        private void BtnCancel_Click(object sender, System.EventArgs e)
        {
            OnCancel?.Invoke();

            dialog.Dismiss();
            dialog.Hide();
        }
Beispiel #9
0
 /// <summary>
 /// 更新检查输入
 /// </summary>
 void Update()
 {
     if (Input.GetButtonDown("Submit") || Input.GetKeyDown(KeyCode.Return))
     {
         OnSubmit();
     }
     if (Input.GetButtonDown("Cancel"))
     {
         OnCancel?.Invoke();
     }
     if (Input.GetButtonDown("Vertical") && Input.GetAxis("Vertical") > 0)
     {
         ForcusControl(mActiveControl?.FindSelectableOnUp());
     }
     if (Input.GetButtonDown("Vertical") && Input.GetAxis("Vertical") < 0)
     {
         ForcusControl(mActiveControl?.FindSelectableOnDown());
     }
     if (Input.GetButtonDown("Horizontal") && Input.GetAxis("Horizontal") > 0)
     {
         ForcusControl(mActiveControl?.FindSelectableOnRight());
     }
     if (Input.GetButtonDown("Horizontal") && Input.GetAxis("Horizontal") < 0)
     {
         ForcusControl(mActiveControl?.FindSelectableOnLeft());
     }
 }
Beispiel #10
0
 private void _cancel(object obj)
 {
     if (!IsModified || MessageBox.Show("Zmienione dane nie zostały przeniesione do JPK.\nRezygnujesz?", "Ostrzeżenie", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         OnCancel?.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #11
0
        private void Update()
        {
            if (interactionsEnabled)
            {
                if (interactionsCooling)
                {
                    interactionsCooling = false;
                    return;
                }

                if (Input.GetButtonDown(KeyCodeConsts.Use))
                {
                    OnConfirm?.Invoke(INPUT_TYPE.USE);
                    interactionController.Interact();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Cancel))
                {
                    OnCancel?.Invoke(INPUT_TYPE.CANCEL);
                    interactionController.Cancel();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Inventory))
                {
                    OnInventory?.Invoke(INPUT_TYPE.INVENTORY);
                }
            }
        }
Beispiel #12
0
 /// <summary>
 /// Assigns all events to the selectable, since there are so many of them.
 /// </summary>
 /// <param name="selectable">The selectable to assign events to.</param>
 /// <param name="i">The index of the methods array.</param>
 /// <param name="j">The number to pass into the method.</param>
 private void AssignSelectable(KMSelectable selectable, ref int i, ref int j)
 {
     if (OnCancel != null && i < OnCancel.Length)
     {
         selectable.OnCancel += OnCancel[i](j);
     }
     if (OnDefocus != null && i < OnDefocus.Length)
     {
         selectable.OnDefocus += OnDefocus[i](j);
     }
     if (OnDeselect != null && i < OnDeselect.Length)
     {
         selectable.OnDeselect += OnDeselect[i](j);
     }
     if (OnFocus != null && i < OnFocus.Length)
     {
         selectable.OnFocus += OnFocus[i](j);
     }
     if (OnHighlight != null && i < OnHighlight.Length)
     {
         selectable.OnHighlight += OnHighlight[i](j);
     }
     if (OnHighlightEnded != null && i < OnHighlightEnded.Length)
     {
         selectable.OnHighlightEnded += OnHighlightEnded[i](j);
     }
     if (OnInteract != null && i < OnInteract.Length)
     {
         selectable.OnInteract += OnInteract[i](j);
     }
     if (OnInteractEnded != null && i < OnInteractEnded.Length)
     {
         selectable.OnInteractEnded += OnInteractEnded[i](j);
     }
     if (OnLeft != null && i < OnLeft.Length)
     {
         selectable.OnLeft += OnLeft[i](j);
     }
     if (OnRight != null && i < OnRight.Length)
     {
         selectable.OnRight += OnRight[i](j);
     }
     if (OnSelect != null && i < OnSelect.Length)
     {
         selectable.OnSelect += OnSelect[i](j);
     }
 }
Beispiel #13
0
 void Cancel()
 {
     OnCancel.AttemptCall();
     if (Setups != null)
     {
         Setups.ForEach(setup => setup.Remove());
     }
 }
Beispiel #14
0
 public void Cancel()
 {
     if (!IsCancelled)
     {
         OnCancel?.Invoke();
         IsCancelled = true;
     }
 }
    public IEnumerator Cancel_Async()
    {
        cancelButton.interactable = false;
        yield return(OnCancel?.Invoke());

        HostPanel.SetActive(false);
        cancelButton.interactable = true;
    }
Beispiel #16
0
        public void CancelAlarm()
        {
            var ser = DependencyService.Get <AndroidAlarmService>();

            ser.Remind(CurrentAlarm);
            //alarm iptal
            OnCancel?.Invoke(this, new EventArgs());
        }
Beispiel #17
0
 private async Task Cancel(MouseEventArgs args)
 {
     if (OnCancel.HasDelegate)
     {
         await OnCancel.InvokeAsync(args);
     }
     await base.Hide();
 }
Beispiel #18
0
 public void OnCancelCallback()
 {
     if (_blockClose)
     {
         return;
     }
     OnCancel?.Invoke(this);
     this.Flush();
 }
        public SaveLuaPage(string DefaultName, OnSave SaveCallback, OnCancel CancelCallback)
        {
            InitializeComponent();

            this.SaveCallback   = SaveCallback;
            this.CancelCallback = CancelCallback;

            FilenameEntry.Text = DefaultName;
        }
 public static void Show(string prompt, string defaultInput, OnEnter successCallback, OnCancel failCallback)
 {
     EditorTextPrompt window = GetWindow<EditorTextPrompt>();
     window._displayedInput = defaultInput;
     window._windowPrompt = prompt;
     window._enterCB = successCallback;
     window._cancelCB = failCallback;
     window.Show();
 }
Beispiel #21
0
 public void OnBtnCancelClicked()
 {
     this.gameObject.SetActive(false);
     if (cancelFunc != null)
     {
         cancelFunc.Invoke();
     }
     cancelFunc = null;
 }
Beispiel #22
0
        protected virtual void InvokeCancel()
        {
            OnCancel handler = OnCanceled;

            if (handler != null)
            {
                handler();
            }
        }
        /// <summary>
        /// Action to be taken when the cancel button is pressed
        /// </summary>
        private void Cancel(bool close = false)
        {
            OnCancel.SafeInvoke(this);

            if (close)
            {
                Close();
            }
        }
Beispiel #24
0
    public void OnDestroy()
    {
        if (OnFocus != null)
        {
            foreach (Delegate d in OnFocus.GetInvocationList())
            {
                OnFocus -= (Action <IDialog>)d;
            }
            OnFocus = null;
        }

        if (OnBlur != null)
        {
            foreach (Delegate d in OnBlur.GetInvocationList())
            {
                OnBlur -= (Action <IDialog>)d;
            }
            OnBlur = null;
        }

        if (OnShow != null)
        {
            foreach (Delegate d in OnShow.GetInvocationList())
            {
                OnShow -= (Action <IDialog>)d;
            }
            OnShow = null;
        }

        if (OnHide != null)
        {
            foreach (Delegate d in OnHide.GetInvocationList())
            {
                OnHide -= (Action <IDialog>)d;
            }
            OnHide = null;
        }

        if (OnClose != null)
        {
            foreach (Delegate d in OnClose.GetInvocationList())
            {
                OnClose -= (Action <IDialog>)d;
            }
            OnClose = null;
        }

        if (OnCancel != null)
        {
            foreach (Delegate d in OnCancel.GetInvocationList())
            {
                OnCancel -= (Action <IDialog>)d;
            }
            OnCancel = null;
        }
    }
 public virtual void InvokeClickOutside()
 {
     if (Visible && CloseOnOutsideClick == true)
     {
         StartDate = OldStartValue;
         EndDate   = OldEndValue;
         Close();
         OnCancel.InvokeAsync(false);
     }
 }
Beispiel #26
0
        public async Task ClickCancel(MouseEventArgs e)
        {
            TStartDate = StartDate;
            TEndDate   = EndDate;
            HoverDate  = null;

            await Close();

            await OnCancel.InvokeAsync(e != null);
        }
        public void Cancel(Exception ex)
        {
            if (IsCancel)
            {
                return;
            }

            IsCancel = true;
            OnCancel?.Invoke(ex);
        }
Beispiel #28
0
        public async void Cancel_Clicked(object sender, EventArgs e)
        {
            bool answer = await Shell.Current.DisplayAlert("", Language.ban_co_chac_chan_muon_huy_khong, Language.huy, Language.tiep_tuc);

            if (answer)
            {
                Clear();
                OnCancel?.Invoke(this, EventArgs.Empty);
            }
        }
Beispiel #29
0
 public void OnShow(string title, string msg, BtnStatus bs, OnOK _okFunc, OnCancel _cancelFunc)
 {
     okFunc        = _okFunc;
     cancelFunc    = _cancelFunc;
     txtTitle.text = title;
     txtMsg.text   = msg;
     btnCancel.gameObject.SetActive((bs & BtnStatus.BS_Cancel) > 0);
     btnOK.gameObject.SetActive((bs & BtnStatus.BS_OK) > 0);
     this.gameObject.SetActive(true);
 }
Beispiel #30
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            FormClosingEventArgs args = new FormClosingEventArgs(CloseReason.UserClosing, false);

            OnCancel?.Invoke(this, args);

            if (args.Cancel == false)
            {
                Close();
            }
        }
Beispiel #31
0
        public void Authenticate(string clientId, string scope, Uri authorizeUrl, Uri redirectUrl)
        {
            var window = UIApplication.SharedApplication.KeyWindow;
            var vc     = window.RootViewController;

            while (vc.PresentedViewController != null)
            {
                vc = vc.PresentedViewController;
            }

            var auth = new iOSOAuth2Authenticator(
                clientId: clientId,         // your OAuth2 client id
                scope: scope,               // the scopes for the particular API you're accessing, delimited by "+" symbols
                authorizeUrl: authorizeUrl, // the auth URL for the service
                redirectUrl: redirectUrl);  // the redirect URL for the service

            auth.AllowCancel = true;
            auth.ShowErrors  = false;
            EventHandler <AuthenticatorErrorEventArgs>     errorDelegate     = null;
            EventHandler <AuthenticatorCompletedEventArgs> completedDelegate = null;

            errorDelegate = (sender, eventArgs) =>
            {
                OnError?.Invoke(this, eventArgs.Message);

                auth.Error     -= errorDelegate;
                auth.Completed -= completedDelegate;
            };

            completedDelegate = (sender, eventArgs) => {
                // UI presented, so it's up to us to dimiss it on iOS
                // dismiss ViewController with UIWebView or SFSafariViewController
                vc.DismissViewController(true, null);


                if (eventArgs.IsAuthenticated)
                {
                    OnSuccess?.Invoke(this, eventArgs.Account.Properties["access_token"]);
                }
                else
                {
                    // The user cancelled

                    OnCancel?.Invoke(this, EventArgs.Empty);
                }
                auth.Error     -= errorDelegate;
                auth.Completed -= completedDelegate;
            };

            auth.Error     += errorDelegate;
            auth.Completed += completedDelegate;

            vc.PresentViewController(auth.GetUI(), true, null);
        }