Beispiel #1
0
 public static string[] GetSameFolderReferences(string assemblyPath)
 {
     using (DomainIsolator isolator = new DomainIsolator("GetSameFolderReferences"))
     {
         return(isolator.GetInstance <CustomTypeInspector>().GetSameFolderReferences(assemblyPath, false));
     }
 }
Beispiel #2
0
        public static FileWithVersionInfo[] GetSameFolderAssemblyReferenceChain(IEnumerable <string> assemblyFilePaths)
        {
            string[] strArray = (from path in assemblyFilePaths
                                 where _refCache.NeedsUpdate(path)
                                 select path).ToArray <string>();
            if (strArray.Length > 0)
            {
                using (DomainIsolator isolator = new DomainIsolator("GetSameFolderAssemblyReferenceChain"))
                {
                    isolator.GetInstance <CustomTypeInspector>().UpdateSameFolderAssemblyReferenceChain(_refCache, strArray);
                }
            }
            List <FileWithVersionInfo> results      = new List <FileWithVersionInfo>();
            HashSet <string>           visitedPaths = new HashSet <string>();

            foreach (string str in assemblyFilePaths)
            {
                GetRefsWithDescendants(str, visitedPaths, results);
            }
            return((from g in from r in results group r by Path.GetFileName(r.FilePath).ToUpperInvariant()
                    select(from r in g
                           orderby r.LastWriteTimeUtc descending
                           select r).First <FileWithVersionInfo>() into r
                    orderby r.FilePath
                    select r).ToArray <FileWithVersionInfo>());
        }
Beispiel #3
0
 private static RefInfo[] GetRefs(string[] assemPaths, string[] gacNames)
 {
     using (DomainIsolator isolator = new DomainIsolator("Inspect Custom Assembly for Refs"))
     {
         return(isolator.GetInstance <CustomTypeInspector>().GetRefs(assemPaths, gacNames));
     }
 }
Beispiel #4
0
 public static string[] GetNamespaces(string assemblyPath)
 {
     using (DomainIsolator isolator = new DomainIsolator("GetNamespaces"))
     {
         return(isolator.GetInstance <CustomTypeInspector>().GetNamespaces(assemblyPath));
     }
 }
Beispiel #5
0
 public static string[] GetTypeNames(string assemblyPath, string baseTypeName)
 {
     assemblyPath = assemblyPath.Trim();
     using (DomainIsolator isolator = new DomainIsolator("Inspect Custom Assembly"))
     {
         return(isolator.GetInstance <CustomTypeInspector>().GetTypeNames(assemblyPath, baseTypeName));
     }
 }
            private void UpdateSchema()
            {
                object obj2;

                LINQPad.Repository repository;
                lock ((obj2 = this._locker))
                {
                    if ((this._worker != Thread.CurrentThread) || this._disposed)
                    {
                        return;
                    }
                    this._status = "Populating";
                }
                this.NotifyChange();
                TempFileRef  random          = TempFileRef.GetRandom("TypedDataContext", ".dll");
                AssemblyName assemblyToBuild = new AssemblyName(Path.GetFileNameWithoutExtension(random.FileName))
                {
                    CodeBase = random.FullPath
                };

                lock ((obj2 = this._locker))
                {
                    if ((this._worker != Thread.CurrentThread) || this._disposed)
                    {
                        return;
                    }
                    repository = this._repository.Clone();
                }
                IEnumerable <ExplorerItem> enumerable = null;
                string nameSpace = "LINQPad.User";
                string typeName  = "TypedDataContext";
                IDictionary <string, object> sessionData = null;

                using (DomainIsolator isolator = new DomainIsolator(repository.DriverLoader.CreateNewDriverDomain("LINQPad Schema Generator", null, null)))
                {
                    enumerable = isolator.GetInstance <SchemaBuilder>().GetSchemaAndBuildAssembly(repository.GetStore().ToString(), assemblyToBuild, ref nameSpace, ref typeName, Program.AllowOneToOne, out sessionData);
                }
                lock ((obj2 = this._locker))
                {
                    if (this._worker == Thread.CurrentThread)
                    {
                        this._repository.AutoGenNamespace           = nameSpace;
                        this._repository.AutoGenTypeName            = typeName;
                        this._repository.IsAutoGenAssemblyAvailable = true;
                        if (sessionData != null)
                        {
                            this._repository.SessionData = sessionData;
                        }
                        this._schema       = enumerable;
                        this._assemblyPath = random;
                    }
                }
            }