Пример #1
0
        //----- property -----

        //----- method -----

        /// <summary>
        /// 遷移中に外部処理の待機開始.
        /// </summary>
        public WaitHandler BeginWait()
        {
            var waitHandler = new WaitHandler();

            waitHandler.OnDisposeAsObservable()
            .Subscribe(_ => FinishWait(waitHandler))
            .AddTo(Disposable);

            waitHandlerIds.Add(waitHandler.Identifier);

            return(waitHandler);
        }
Пример #2
0
        /// <summary>
        /// <see cref="BeginWait"/>から取得された<see cref="WaitHandler"/>で待ち状態を解除.
        /// </summary>
        public void FinishWait(WaitHandler waitHandler)
        {
            if (waitHandler == null)
            {
                return;
            }

            if (!waitHandlerIds.Contains(waitHandler.Identifier))
            {
                return;
            }

            waitHandlerIds.Remove(waitHandler.Identifier);
        }