Ejemplo n.º 1
0
        void FirstCompile(string path)
        {
            Logger.Log("first compile: " + path);

            var dir  = new DirectoryInfo(path);
            var list = dir.GetFiles("*.cs", SearchOption.AllDirectories).ToList();

            foreach (var file in list)
            {
                string filePath = file.FullName;
                var    project  = CompilationManager.GetProjectFromFile(filePath);
                // skip because already compiled
                if (project == null)
                {
                    var assembly = TryCompile(filePath);

                    if (assembly != null)
                    {
                        RefreshAssembly(filePath, assembly);
                    }
                    else
                    {
                        Logger.Log("first compile error: " + file.FullName);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        void FirstCompile(string path)
        {
            Logger.Log("first compile: " + path);

            var dir  = new DirectoryInfo(path);
            var list = dir.GetFiles("*.cs", SearchOption.AllDirectories).ToList();

            List <Tuple <string, Assembly> > assemblies = new();

            foreach (var file in list)
            {
                string filePath = file.FullName;
                var    project  = CompilationManager.GetProjectFromFile(filePath);
                // skip because already compiled
                if (project == null)
                {
                    var assembly = TryCompile(filePath);

                    if (assembly != null)
                    {
                        assemblies.Add(new Tuple <string, Assembly>(filePath, assembly));
                        //RefreshAssembly(filePath, assembly);
                    }
                    else
                    {
                        Logger.Log("first compile error: " + file.FullName);
                        Logger.Log("");
                    }
                }
            }

            assemblies.ForEach((tuple) => RefreshAssembly(tuple.Item1, tuple.Item2));
        }