コード例 #1
0
        public void SaveTranslation(string path)
        {
            IAsset file = new Asset(path);
            SassAndScssTranslator translator = new SassAndScssTranslator();
            var compiled = translator.Translate(file);

            var normalCSS = path.Replace("." + FileExtension, ".css");

            using (var compiledCSS = File.CreateText(HostingEnvironment.MapPath(normalCSS)))
            {
                compiledCSS.Write(compiled.Content);
                compiledCSS.Close();
            }
        }
コード例 #2
0
        public IEnumerable <Exception> ValidateTranslation(string path)
        {
            var retVal = new List <Exception>();

            try
            {
                IAsset file = new Asset(path);
                SassAndScssTranslator translator = new SassAndScssTranslator();
                translator.Translate(file);
            }
            catch (AssetTranslationException ex)
            {
                retVal.Add(ex);
            }

            return(retVal);
        }