Пример #1
0
 internal EventLoopContext(DefaultHostRunner runner, IContext context)
 {
     _runner = runner ?? throw new ArgumentNullException(nameof(runner));
     context = context ?? throw new ArgumentNullException(nameof(context));
     if (context is InitFinalContext initContext)
     {
         _init = initContext;
         _msg  = initContext.GetMessage();
         if (initContext?.IsFinalizationPhase() ?? false)
         {
             throw new InvalidOperationException(Resources.EventLoopContext_InvalidOperationException);
         }
     }
     else if (context is EventLoopContext prevContext)
     {
         _init = prevContext._init;
         _prev = prevContext;
         _msg  = prevContext._msg;
         // 2つ前の文脈情報を削除してメモリ節約
         prevContext._prev?.Dispose();
         prevContext._prev = null;
     }
     else
     {
         throw new ArgumentException(Resources.EventLoopContext_ArgumentException, nameof(context));
     }
     this.Paths     = context.Paths;
     this.Settings  = context.Settings;
     this.Arguments = context.Arguments;
     this.LogFile   = context.LogFile;
 }
Пример #2
0
 internal InitFinalContext(DefaultHostRunner runner, InitFinalContext?initContext)
 {
     _runner        = runner;
     _initContext   = initContext;
     _msg           = initContext?._msg;
     this.Paths     = initContext?.Paths;
     this.Settings  = initContext?.Settings;
     this.Arguments = initContext?.Arguments;
     this.LogFile   = initContext?.LogFile;
     if (initContext?.IsFinalizationPhase() ?? false)
     {
         throw new InvalidOperationException(Resources.InitFinalContext_InvalidOperationException);
     }
 }
Пример #3
0
 internal Configuration(DefaultHostRunner runner)
 {
     _runner = runner;
 }