コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PortSession"/> class.
 /// Constructor, given a configuration.
 /// </summary>
 /// <param name="config">The configuration to use.</param>
 public PortSession(PortConfig config = null) : base(config, new PortBackEnd(config))
 {
     // Because they are usually used in child scripts, port sessions are auto-start
     // by default.
     if (config == null || config.AutoStart)
     {
         var startResult = Start();
         if (!startResult.Success)
         {
             throw new X3270ifInternalException("Session failed to start: " + startResult.FailReason);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PortBackEnd"/> class.
 /// Constructor, given a configuration.
 /// </summary>
 /// <param name="config">The configuration to use.</param>
 public PortBackEnd(PortConfig config)
 {
     this.portConfig = config ?? new PortConfig();
 }