public override void Cancel(GameEventData data = null) { //Debug.Log("Cancel Select : " + m_Blocks.Count); if (m_selectedCardPreviewList.Count == 0) { if (!m_CanCancel) { return; } HideInfo(); Unregister(); UnhighlightAll(); if (cancelCallback != null) { cancelCallback.Invoke(); } else { ActionManager.Instance.CancelAction(); } cancelCallback = null; } else { UnselectTarget(); } }
public bool RemoveConfirmListener(CancelCallback callback, object userData) { CancelListener item = new CancelListener(); item.SetCallback(callback); item.SetUserData(userData); return(this.m_cancelListeners.Remove(item)); }
public void GetInfo(CancelCallback method) { cancelCallback = method; Unit none = null; GetInfo(none); }
public WarningDialog(Rectangle bounds, string message, OkayCallback okayCallback, CancelCallback cancelCallback) : base(bounds.X, bounds.Y, bounds.Width, bounds.Height, true) { OnOkay = okayCallback; OnCancel = cancelCallback; exitFunction = Cancel; _message = message; }
public static AnimationBehaviour CreateAnimation <TEase>(this MonoBehaviour monoBehaviour, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = true, object data = null, bool inverse = false) where TEase : IAnimationEase, new() { var ease = new TEase(); return(CreateAnimation(monoBehaviour, ease, duration, delay, name, startCallback, updateCallback, cancelCallback, doneCallback, finishCallback, single, considerTimeScale, data, inverse)); }
private void PromptCancelMessageBox(CancelCallback cancelCallback) { DialogResult dr = MessageBox.Show("取消更新后可能造成无法正常进行游戏,您确定要取消更新吗", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { cancelCallback(); } }
public override void Cancel(CancelCallback callback, object arg) { base.Cancel(callback, arg); conn.State = ConnectionState.Closed; if (conn.Socket.Connected) { conn.Close(); } }
internal DialogCallbacks(DisplayErrorCallback displayError, DisplayLoginCallback displayLogin, DisplayQuestionCallback displayQuestion, DisplayProgressCallback displayProgress, CancelCallback cancel, UpdateProgressCallback updateProgress) { DisplayError = Marshal.GetFunctionPointerForDelegate(displayError); DisplayLogin = Marshal.GetFunctionPointerForDelegate(displayLogin); DisplayQuestion = Marshal.GetFunctionPointerForDelegate(displayQuestion); DisplayProgress = Marshal.GetFunctionPointerForDelegate(displayProgress); Cancel = Marshal.GetFunctionPointerForDelegate(cancel); UpdateProgress = Marshal.GetFunctionPointerForDelegate(updateProgress); }
internal DialogCallbacks(DisplayErrorCallback displayError, DisplayLoginCallback displayLogin, DisplayQuestionCallback displayQuestion, DisplayProgressCallback displayProgress, CancelCallback cancel, UpdateProgressCallback updateProgress) { DisplayError = displayError; DisplayLogin = displayLogin; DisplayQuestion = displayQuestion; DisplayProgress = displayProgress; Cancel = cancel; UpdateProgress = updateProgress; }
public static AnimationBehaviour CreateAnimation(this MonoBehaviour monoBehaviour, AnimationEaseType easeType, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = false, object data = null, bool inverse = false) { var ease = AnimationHelper.EaseTypeToFunction(easeType); return(CreateAnimation(monoBehaviour, ease, duration, delay, name, startCallback, updateCallback, cancelCallback, doneCallback, finishCallback, single, considerTimeScale, data, inverse)); }
public bool RegisterCancelListener(CancelCallback callback, object userData) { CancelListener item = new CancelListener(); item.SetCallback(callback); item.SetUserData(userData); if (this.m_cancelListeners.Contains(item)) { return(false); } this.m_cancelListeners.Add(item); return(true); }
public virtual void Cancel(CancelCallback callback, object arg) { this.cancelHandler = null; if (callback != null) { cancelHandler = new Tuple { Handler = callback, Arg = arg } } ; IsCancelled = true; Set(); }
private void InitCallbacks(ref libvlc_dialog_cbs cbs) { DisplayErrorCallback error = new DisplayErrorCallback(pf_display_error); DisplayLoginCallback login = new DisplayLoginCallback(pf_display_login); DisplayQuestionCallback question = new DisplayQuestionCallback(pf_display_question); DisplayProgressCallback progress = new DisplayProgressCallback(pf_display_progress); CancelCallback cancel = new CancelCallback(pf_cancel); UpdateProgressCallback updateProgress = new UpdateProgressCallback(pf_update_progress); cbs.pf_cancel = Marshal.GetFunctionPointerForDelegate(cancel); cbs.pf_display_error = Marshal.GetFunctionPointerForDelegate(error); cbs.pf_display_login = Marshal.GetFunctionPointerForDelegate(login); cbs.pf_display_progress = Marshal.GetFunctionPointerForDelegate(progress); cbs.pf_display_question = Marshal.GetFunctionPointerForDelegate(question); cbs.pf_update_progress = Marshal.GetFunctionPointerForDelegate(updateProgress); }
private void Done() { if (!m_CanEndEarly && numberLeft > 0) { return; } cancelCallback = null; HideInfo(); UnhighlightAll(); Unregister(); m_Done = true; }
static void Main(String[] args) { LBMContext ctx = null; /* Context object: container for UM "instance". */ /*** Initialization: create necessary UM objects. ***/ try { ctx = new LBMContext(); } catch (LBMException ex) { System.Console.Error.WriteLine("Error initializing LBM objects: " + ex.Message); System.Environment.Exit(1); } Callback cb = new Callback(); AppTimer timer = new AppTimer(ctx, 10000, cb); try { System.Threading.Thread.Sleep(1000); } catch (Exception eex) { System.Console.Error.WriteLine("Error System.Threading.Thread.Sleep() exception: " + eex.Message); System.Environment.Exit(1); } if (timer.state == TimerState.PENDING) { CancelCallback ccb = new CancelCallback(); LBMTimer cancelTimer = new LBMTimer(ctx, 0, ccb.onExpiration, (Object)timer); timer.sync.WaitOne(); } ctx.close(); Console.WriteLine("cts is closed, Press any key to exit..."); Console.ReadLine(); } /* main */
/** * 退单接口 * */ public void cancelPayment(string prepayId, CancelCallback payCallback) { checkBaseInfo(); if (payCallback == null) { throw new Exception("缺少回调"); } if (String.IsNullOrEmpty(prepayId)) { payCallback.onFailed("-2", "prepayId不能为空"); return; } ReqCancelBean reqCancelBean = new ReqCancelBean(); reqCancelBean.prepayId = prepayId; reqCancelBean.timestamp = CommonUtil.GetTimeStamp(); reqCancelBean.generateSign(mchKey); HttpClient client = new HttpClient(); String url = Config.HOST + Config.REVODE_ORDER; String jsonBody = JsonUtil.SerializeObject(reqCancelBean); BaseResponse <PayResultBean> response = client.PostDataHttp <BaseResponse <PayResultBean> >(mchId, url, null, null, jsonBody); if (response == null) { payCallback.onFailed("-1", "Result is null!"); } else if ("000000".Equals(response.Code)) { payCallback.onSuccess(response.data); } else { payCallback.onFailed(response.Code, response.Message); } }
static void Main(String[] args) { LBMContext ctx = null; /* Context object: container for UM "instance". */ /*** Initialization: create necessary UM objects. ***/ try { ctx = new LBMContext(); } catch(LBMException ex) { System.Console.Error.WriteLine("Error initializing LBM objects: " + ex.Message); System.Environment.Exit(1); } Callback cb = new Callback(); AppTimer timer = new AppTimer(ctx,10000,cb); try { System.Threading.Thread.Sleep(1000); } catch (Exception eex) { System.Console.Error.WriteLine("Error System.Threading.Thread.Sleep() exception: " + eex.Message); System.Environment.Exit(1); } if (timer.state == TimerState.PENDING) { CancelCallback ccb = new CancelCallback(); LBMTimer cancelTimer = new LBMTimer(ctx,0,ccb.onExpiration,(Object)timer); timer.sync.WaitOne(); } ctx.close(); }
/// <summary> /// 实例化CancellableTask /// </summary> /// <param name="workCallback"></param> /// <param name="cancelCallback"></param> public CancellableTask(WorkCallback workCallback, CancelCallback cancelCallback) { this.workCallback = workCallback; this.cancelCallback = cancelCallback; }
public bool RemoveConfirmListener(CancelCallback callback) { return(this.RemoveConfirmListener(callback, null)); }
private void Cancel() { CancelCallback?.Invoke(); CompleteCallback?.Invoke(); ((ICommand)ControlCommands.Close).Execute(null); }
public void Cancel() { CancelCallback?.Invoke(); }
public static AnimationBehaviour CreateAnimation(this MonoBehaviour monoBehaviour, IAnimationEase ease, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = false, object data = null, bool inverse = false) { if (single) { if (string.IsNullOrEmpty(name)) { Debug.Log("Animation can just be single if its name is not empty neither null."); } else { CancelAnimations(monoBehaviour, name); } } var gameObject = monoBehaviour.gameObject; var anim = gameObject.AddComponent <AnimationBehaviour>(); anim.Delay = delay; anim.Name = name; anim.Ease = ease; anim.StartCallback = startCallback; anim.UpdateCallback = updateCallback; anim.FinishCallback = finishCallback; anim.Duration = duration; anim.DoneCallback = doneCallback; anim.CancelCallback = cancelCallback; anim.ConsiderTimeScale = considerTimeScale; anim.Data = data ?? monoBehaviour; anim.Inverse = inverse; anim.Start(); return(anim); }
public bool RegisterCancelListener(CancelCallback callback) { return(this.RegisterCancelListener(callback, null)); }
public void Cancel(string reason, CancelCallback callback) { mSpeechEnroller.Cancel(reason, callback); }
/// <summary> /// 实例化CancellableTask /// </summary> /// <param name="workCallback"></param> /// <param name="cancelCallback"></param> public CancellableTask(WorkCallback workCallback, CancelCallback cancelCallback) { this.workCallback = workCallback; this.cancelCallback = cancelCallback; }
public void Cancel(string reason, CancelCallback callback) { mSpeechVerifier.Cancel(reason, callback); }
/// <summary> /// Invokes the cancel callback /// </summary> public void InvokeCancelCallback() { CancelCallback?.Invoke(); }