Пример #1
0
        /// <summary>
        /// This constructor is for forking.
        /// </summary>
        protected HostEnvironmentBase(HostEnvironmentBase <TEnv> source, Random rand, bool verbose,
                                      string shortName = null, string parentFullName = null)
            : base(shortName, parentFullName, verbose)
        {
            Contracts.CheckValue(source, nameof(source));
            Contracts.CheckValueOrNull(rand);
            _rand       = rand ?? RandomUtils.Create();
            _cancelLock = new object();

            // This fork shares some stuff with the master.
            Master           = source;
            Root             = source.Root;
            ListenerDict     = source.ListenerDict;
            ProgressTracker  = source.ProgressTracker;
            ComponentCatalog = source.ComponentCatalog;
            _children        = new List <WeakReference <IHost> >();
        }
Пример #2
0
 protected override IHost RegisterCore(HostEnvironmentBase <ConsoleEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose)
 {
     return(new Host(source, shortName, parentFullName, rand, verbose));
 }
Пример #3
0
 public Host(HostEnvironmentBase <ConsoleEnvironment> source, string shortName, string parentFullName, Random rand, bool verbose)
     : base(source, shortName, parentFullName, rand, verbose)
 {
     IsCancelled = source.IsCancelled;
 }
Пример #4
0
 protected abstract IHost RegisterCore(HostEnvironmentBase <TEnv> source, string shortName,
                                       string parentFullName, Random rand, bool verbose);
Пример #5
0
 public HostBase(HostEnvironmentBase <TEnv> source, string shortName, string parentFullName, Random rand, bool verbose)
     : base(source, rand, verbose, shortName, parentFullName)
 {
     Depth = source.Depth + 1;
 }
 public HostBase(HostEnvironmentBase <TEnv> source, string shortName, string parentFullName, Random rand, bool verbose)
     : base(source, rand, verbose, shortName, parentFullName)
 {
     Depth     = source.Depth + 1;
     _children = new List <WeakReference <IHost> >();
 }