예제 #1
0
        /// <summary>
        /// To list the errors found in CSS inout file and error's are added into ErrorList.
        /// </summary>
        /// <param name="path">Input CSS Filepath</param>
        public void GetErrorReport(string path)
        {
            if (!File.Exists(path))
            {
                return;
            }

            var ctp = new CssTreeParser();

            try
            {
                ctp.Parse(path);
                ctp.ValidateError();
                if (ctp.Errors.Count > 0)
                {
                    ErrorText += ctp.ErrorText() + "\r\n";
                    string fileName = Path.GetFileName(path);
                    if (ErrorList.ContainsKey(fileName))
                    {
                        ErrorList[fileName].Add(ctp.Errors);
                    }
                    else
                    {
                        var err = new ArrayList();
                        err.AddRange(ctp.Errors);
                        ErrorList[fileName] = err;
                    }
                }
            }
            catch (Exception)
            {
                ErrorText += ctp.Errors;
                throw;
            }
            finally
            {
            }
        }
예제 #2
0
        /// <summary>
        /// To list the errors found in CSS inout file and error's are added into ErrorList.
        /// </summary>
        /// <param name="path">Input CSS Filepath</param>
        public void GetErrorReport(string path)
        {
            if(!File.Exists(path)) return;

            var ctp = new CssTreeParser();
            try
            {
                ctp.Parse(path);
                ctp.ValidateError();
                if (ctp.Errors.Count > 0)
                {
                    ErrorText += ctp.ErrorText() + "\r\n";
                    string fileName = Path.GetFileName(path);
                    if (ErrorList.ContainsKey(fileName))
                    {
                        ErrorList[fileName].Add(ctp.Errors);
                    }
                    else
                    {
                        var err = new ArrayList();
                        err.AddRange(ctp.Errors);
                        ErrorList[fileName] = err;
                    }
                }
            }
            catch (Exception)
            {
                ErrorText += ctp.Errors;
                throw;
            }
            finally
            {
              
            }

        }