コード例 #1
0
        void AddFilesInPath(DoWorkEventArgs e, string projectBasePath, string directory)
        {
            if (StyleFinderUtils.IsMSharpFrontEnd(projectBasePath))
            {
                if (directory.Contains("Website\\Styles") || directory.Contains("Website\\Styles\\"))
                {
                    AddStyleFiles(projectBasePath, directory, "*.less");
                }

                /* Commented du to: This would be an extra job as Geeks do not work with CSS directly
                 *  AddCssFiles(projectBasePath, directory);
                 */
            }

            else
            {
                AddStyleFiles(projectBasePath, directory, "*.scss");
            }

            if (e.Cancel)
            {
                return;
            }

            AddSubdirectories(e, projectBasePath, directory);
        }
コード例 #2
0
        void AddStyleFiles(string projectBasePath, string directory, string filter)
        {
            var scanner = new StyleScanner();

            var files = Directory.GetFiles(directory, filter);

            if (filter == "*.css")
            {
                files = files.Where(f => StyleFinderUtils.IsCompiledFromLess(f) == false).ToArray();
            }

            foreach (var file in files)
            {
                using (var content = File.OpenText(file))
                {
                    var classes = scanner.ExtractClasses(new StyleFinderFileInfoDto
                    {
                        FileContent     = content.ReadToEnd(),
                        FileName        = file,
                        ProjectBasePath = projectBasePath
                    });

                    Repository.AppendRange(classes);
                }
            }
        }
コード例 #3
0
        void AddFilesInPaths(DoWorkEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            var basePaths = BasePaths.Where(p => StyleFinderUtils.IsFrontEndProject(p) && Directory.Exists(p));

            foreach (var directoryPath in basePaths)
            {
                AddFilesInPath(e, directoryPath, directoryPath);
            }
        }