예제 #1
0
 private AppDomain CreateAppDomain(Repository repository, string name)
 {
     AppDomain domain;
     this._loadedAssemblyCount = 0;
     this._cumulativeFootprint = 0L;
     this._cachedDomainPolluted = false;
     _lastRemotelyLoadedAssemblies = this._remotelyLoadedAssemblies;
     this._remotelyLoadedAssemblies = new List<TempFileRef>();
     string data = this.AllowShadow() ? this._shadowFolder : null;
     if (repository != null)
     {
         domain = repository.CreateSchemaAndRunnerDomain("LINQPad Query Server [" + name + "]", data != null, true);
     }
     else
     {
         domain = AppDomainUtil.CreateDomain("LINQPad Query Server [" + name + "]");
     }
     if (data != null)
     {
         domain.SetData("LINQPad.ShadowPath", data);
     }
     return domain;
 }
예제 #2
0
 private static string TestCustomType(Repository r)
 {
     try
     {
         using (DomainIsolator isolator = new DomainIsolator(r.CreateSchemaAndRunnerDomain("Custom Type Test Domain", false, false)))
         {
             isolator.Domain.SetData("repository", r);
             isolator.Domain.DoCallBack(new CrossAppDomainDelegate(CxForm.InstantiateCustomType));
         }
         return null;
     }
     catch (Exception exception)
     {
         string str2 = "The database connection is valid, but the following exception\r\nwas thrown when trying to instantiate the custom " + r.DriverLoader.Driver.ContextBaseTypeName.Split(new char[] { '.' }).Last<string>() + ":\r\n\r\n" + exception.Message;
         if (exception.InnerException != null)
         {
             str2 = str2 + "\r\n\r\nInner Exception: " + exception.InnerException.Message;
         }
         return str2;
     }
 }