コード例 #1
0
ファイル: WebServiceHost.cs プロジェクト: xyrus02/foundation
        protected sealed override IResult Execute(CancellationToken cancellationToken)
        {
            Log.WriteInformation($"{DisplayName} listening");

            WaitHandler.Wait(() => cancellationToken.IsCancellationRequested);

            return(Result.Success);
        }
コード例 #2
0
        public void WaitForKey()
        {
            if (Console.IsErrorRedirected || Console.IsOutputRedirected || Console.IsInputRedirected)
            {
                return;
            }

            WaitHandler.Wait(() => Console.KeyAvailable);
            Console.ReadKey(true);
        }
コード例 #3
0
        public static void Main()
        {
            {
                SimpleMind.SimpleMind Log         = new SimpleMind.SimpleMind();
                ServiceHost           bone_server = IPCConnection.ServerConnect();
                ServiceFisshBone.Init();

                WaitHandler.Wait();
                bone_server.Close();
                Log.writeLog(SimpleMind.Loglevel.Debug, "FiSSHBoneMain", "FiSSHBone exit.");
            }
        }
コード例 #4
0
ファイル: Application.cs プロジェクト: xyrus02/foundation
        public void Cancel()
        {
            if (!IsRunning || mCancel == null)
            {
                return;
            }

            CancellingOverride();

            mCancel?.Cancel();
            WaitHandler.Wait(() => !IsRunning);

            mCancel?.Dispose();
            mCancel = null;

            CancelOverride();
        }
コード例 #5
0
        public void WaitForKey(ConsoleKey key, ConsoleModifiers modifiers = default(ConsoleModifiers))
        {
            if (Console.IsErrorRedirected || Console.IsOutputRedirected || Console.IsInputRedirected)
            {
                return;
            }

            WaitHandler.Wait(
                () =>
            {
                if (!Console.KeyAvailable)
                {
                    return(false);
                }

                var interceptedKey = Console.ReadKey(true);
                return
                (interceptedKey.Key == key &&
                 interceptedKey.Modifiers == modifiers);
            });
        }
コード例 #6
0
ファイル: Application.cs プロジェクト: xyrus02/foundation
 void IOperation.Wait()
 {
     WaitHandler.Wait(() => IsRunning || IsCompleted);
     WaitHandler.Wait(() => !IsRunning);
 }
コード例 #7
0
        protected sealed override IResult Execute(CancellationToken cancellationToken)
        {
            WaitHandler.Wait(() => cancellationToken.IsCancellationRequested);

            return(Result.Success);
        }
コード例 #8
0
ファイル: Sprite.cs プロジェクト: tml/Scratch-Library
 public void WaitTillGlideFinished()
 {
     waitHandle.Wait();
 }
コード例 #9
0
ファイル: Sprite.cs プロジェクト: tml/Scratch-Library
 public void WaitTillSayFinished()
 {
     waitHandle.Wait();
 }
コード例 #10
0
 public void WaitForEnded()
 {
     WaitHandler.Wait(() => !IsRunning);
 }
コード例 #11
0
 public void WaitForStarted()
 {
     WaitHandler.Wait(() => IsRunning || IsCompleted);
 }