Пример #1
0
 public override List<ExplorerItem> GetSchemaAndBuildAssembly(IConnectionInfo cxInfo, AssemblyName assemblyToBuild, ref string nameSpace, ref string typeName)
 {
     var settings = GetCxSettings(cxInfo);
     var schemaBuilderType = settings.SchemaBuilderType;
     if (schemaBuilderType == null) { return null; }
     var builder = schemaBuilderType.GetInstance<ISchemaBuilder>();
     if (builder == null) { return null; }
     var paths = new List<string>() {Path.Combine(settings.WebRootPath, "bin")};
     using (var context = new AssemblyLoadingContext(paths))
     {
         return builder.BuildAssembly(cxInfo, assemblyToBuild, ref nameSpace, ref typeName);
     }
 }
 public virtual IEnumerable<Type> GetValidTypesForAppConfigReaderType(Assembly assembly)
 {
     if (assembly == null) { return null; }
     var paths = new List<string>();
     using (var context = new AssemblyLoadingContext(paths))
     {
         return (from t in assembly.GetTypes()
             where
                 ((t.IsPublic && !t.IsAbstract) && (t.GetConstructor(System.Type.EmptyTypes) != null)) &&
                 typeof (IAppConfigReader).IsAssignableFrom(t)
             orderby t.AssemblyQualifiedName
             select t);
     }
 }
 public virtual IEnumerable<Type> GetValidTypesForSearchResultItem(Assembly assembly)
 {
     if (assembly == null) { return null; }
     var paths = new List<string>();
     using (var context = new AssemblyLoadingContext(paths))
     {
         return (from t in assembly.GetTypes()
             where
                 (t.IsPublic && !t.IsAbstract) && (t.GetConstructor(System.Type.EmptyTypes) != null)
             orderby t.AssemblyQualifiedName
             select t);
     }
 }