コード例 #1
0
        public void LoadLinesOfCode()
        {
            LoadLinesOfCodeForModule(_module);

            if (_countSubmodules)
            {
                var submodules = _module.GetSubmodulesInfo()
                                 .Select(submodule => new VsrModule(Path.Combine(_module.WorkingDir, submodule.LocalPath)));

                foreach (var submodule in submodules)
                {
                    LoadLinesOfCodeForModule(submodule);
                }
            }

            // Send 'changed' event when done
            OnLineCounterUpdated(_lineCounter, EventArgs.Empty);

            return;

            void LoadLinesOfCodeForModule(IVsrModule module)
            {
                var filesToCheck = module
                                   .GetTree(module.RevParse("HEAD"), full: true)
                                   .Select(file => Path.Combine(module.WorkingDir, file.Name))
                                   .ToList();

                _lineCounter.FindAndAnalyzeCodeFiles(_codeFilePattern, DirectoriesToIgnore, filesToCheck);
            }
        }