예제 #1
0
        public StringBuilder ProcessGroups(IPathProvider pathProvider, IJsCrusher jsCrusher, JsGroupElementCollection jsGroups)
        {
            var output = new StringBuilder("Js Files created:\r\n");

            Action <JsGroupToProcess> processJsGroup = ProcessJsGroup;

            var jsGroupsToProcess = jsGroups.Cast <JsGroupElement>()
                                    .Select(group => new JsGroupToProcess
            {
                Crusher      = jsCrusher,
                PathProvider = pathProvider,
                Group        = group,
                Output       = output
            }).ToList();

            if (jsGroupsToProcess.Any())
            {
                ParallelExecute.EachParallel(jsGroupsToProcess, processJsGroup);
            }
            else
            {
                output.AppendFormat("No files to process");
            }
            return(output);
        }
        public StringBuilder ProcessGroups(IPathProvider pathProvider, ICssSpriteCreator cssSpriteCreator, CssSpriteGroupElementCollection cssSpriteGroups)
        {
            var output = new StringBuilder("Css Sprite Files created:\r\n");

            Action <CssSpriteGroupToProcess> processJsGroup = ProcessJsGroup;

            var cssSpriteGroupToProcess = cssSpriteGroups.Cast <CssSpriteGroupElement>()
                                          .Select(group => new CssSpriteGroupToProcess
            {
                CssSpriteCreator = cssSpriteCreator,
                PathProvider     = pathProvider,
                Group            = group,
                Output           = output
            }).ToList();

            if (cssSpriteGroupToProcess.Any())
            {
                ParallelExecute.EachParallel(cssSpriteGroupToProcess, processJsGroup);
            }
            else
            {
                output.AppendFormat("No files to process");
            }
            return(output);
        }