コード例 #1
0
        public static void UpdateParseCacheAsync(ASTStorage Cache)
        {
            // Return immediately if nothing there to parse
            if (Cache.ParsedGlobalDictionaries.Count < 1)
            {
                return;
            }

            var th = new Thread(() =>
            {
                try
                {
                    LoggingService.LogInfo("Update parse cache ({0} directories) - this may take a while!", Cache.ParsedGlobalDictionaries.Count);

                    var perfResults = Cache.UpdateCache();

                    foreach (var perfData in perfResults)
                    {
                        LoggingService.LogInfo(
                            "Parsed {0} files in \"{1}\" in {2}s (~{3}ms per file)",
                            perfData.AmountFiles,
                            perfData.BaseDirectory,
                            Math.Round(perfData.TotalDuration, 3),
                            Math.Round(perfData.FileDuration * 1000));
                    }
                }
                catch (Exception ex)
                {
                    LoggingService.LogError("Error while updating parse caches", ex);
                }
            });

            th.IsBackground = true;
            th.Start();
        }
コード例 #2
0
ファイル: DIncludesParser.cs プロジェクト: nazriel/Mono-D
 public void AddDirectory(string directory, ASTStorage storage)
 {
     lock (directoriesToParse){
         directoriesToParse.Enqueue(new DDirectoryParserItem(directory, storage));
     }
     start();
 }
コード例 #3
0
 public void AddDirectory(string directory, ASTStorage storage)
 {
     lock (directoriesToParse){
         directoriesToParse.Enqueue(new DDirectoryParserItem(directory, storage));
     }
     start();
 }
コード例 #4
0
        void Init()
        {
            LocalIncludeCache = new ASTStorage();

            //if(DCompiler.Instance!=null)
            //	UsedCompilerVendor = DCompiler.Instance.DefaultCompiler;
        }
コード例 #5
0
ファイル: DIncludesParser.cs プロジェクト: nazriel/Mono-D
 public void AddDirectoryRange(List<string> directories, ASTStorage storage)
 {
     foreach(string directory in directories)
     {
         lock(directoriesToParse){
             directoriesToParse.Enqueue(new DDirectoryParserItem(directory, storage));
         }
     }
     start();
 }
コード例 #6
0
 public void AddDirectoryRange(List <string> directories, ASTStorage storage)
 {
     foreach (string directory in directories)
     {
         lock (directoriesToParse){
             directoriesToParse.Enqueue(new DDirectoryParserItem(directory, storage));
         }
     }
     start();
 }
コード例 #7
0
ファイル: DIncludesParser.cs プロジェクト: nazriel/Mono-D
 public DDirectoryParserItem(string directory, ASTStorage storage)
 {
     this.Directory = directory;
     this.Storage = storage;
 }
コード例 #8
0
        public static void UpdateParseCacheAsync(ASTStorage Cache)
        {
            // Return immediately if nothing there to parse
            if (Cache.ParsedGlobalDictionaries.Count < 1)
                return;

            var th = new Thread(() =>
            {
                try
                {
                    LoggingService.LogInfo("Update parse cache ({0} directories) - this may take a while!", Cache.ParsedGlobalDictionaries.Count);

                    var perfResults = Cache.UpdateCache();

                    foreach (var perfData in perfResults)
                    {
                        LoggingService.LogInfo(
                            "Parsed {0} files in \"{1}\" in {2}s (~{3}ms per file)",
                            perfData.AmountFiles,
                            perfData.BaseDirectory,
                            Math.Round(perfData.TotalDuration,3),
                            Math.Round( perfData.FileDuration*1000));
                    }
                }
                catch (Exception ex)
                {
                    LoggingService.LogError("Error while updating parse caches", ex);
                }
            });

            th.IsBackground = true;
            th.Start();
        }
コード例 #9
0
ファイル: DProject.cs プロジェクト: nazriel/Mono-D
        void Init()
        {
            LocalIncludeCache = new ASTStorage();

            //if(DCompiler.Instance!=null)
            //	UsedCompilerVendor = DCompiler.Instance.DefaultCompiler;
        }
コード例 #10
0
 public DDirectoryParserItem(string directory, ASTStorage storage)
 {
     this.Directory = directory;
     this.Storage   = storage;
 }