public void ClassSetup()
 {
     _handler = new CleanUpHandler(_dialog, _logger, TimeSpan.Zero);
     // Make the logger invoke passing method.
     _logger.When(e => e.LogExec(Arg.Any <Expression <Func <bool> > >()))
     .Do(e => e.ArgAt <Expression <Func <bool> > >(0).Compile().Invoke());
 }
Пример #2
0
 private static bool CleanUp(CleanUpCmdArgs args, ILogger logger)
 {
     using (var handler = new CleanUpHandler(logger, TimeSpan.FromSeconds(args.Timeout)))
     {
         handler.Handle();
         return(handler.IsHandled);
     }
 }
        /// <summary>
        /// Installs some necessary callbacks and event handlers into the game core from the game form.
        /// </summary>
        internal void ConfigureGameCoreWithFormCallbacks <T>(GameCore <T> gameCore)
            where T : BaseGameModel
        {
            gameCore.InstallGetTotalDrawingSizeHandler(this.GetTotalAvailableSize);
            gameCore.InstallInvalidateDrawingSurfaceHandler(this.Invalidate);
            gameCore.InstallAcceptLatestBitmapFrameHandler(this.AcceptLatestBitmapFrame);
            gameCore.InstallLocalizeScreenMousePositionHandler(this.ConvertPointToClient);
            gameCore.InstallMainFormHasFocusCb(this.HasFocus);

            m_cleanUpGameCoreHandler = gameCore.CleanUp;
        }