protected virtual T CreateDomainManager()
 {
     //
     // Acquire a reference to a new service manager
     // running in the appdomain.
     //
     return(RemoteDomainManager.CreateInDomain <T>(_domain));
 }
コード例 #2
0
        public virtual void RunTestCase(string testCase)
        {
            Type remoteDomainType = typeof(RemoteDomain <>).MakeGenericType(new Type[] { this.GetType() });

            PropertyInfo domainManagerPropertyInfo = remoteDomainType.GetProperty("DomainManager");

            string configuration = GetConfiguration(testCase);

            object remoteDomain = null;

            try
            {
                remoteDomain = Activator.CreateInstance(remoteDomainType, this.GetType().ToString(), CommonConfigurationHeader + configuration + CommonConfigurationFooter);
                RemoteDomainManager domainManager = (RemoteDomainManager)domainManagerPropertyInfo.GetValue(remoteDomain, null);
                domainManager.Start(testCase);
            }
            finally
            {
                if (null != remoteDomain)
                {
                    ((IDisposable)remoteDomain).Dispose();
                }
            }
        }