Exemple #1
0
        public CapDocument(string filePath)
        {
            var       fileStream = File.OpenRead(filePath);
            XDocument xDocument  = XDocument.Load(fileStream);

            capValidateResults = CapValidator.Validate(xDocument);
            //if (IsValid()) {                //不論是否驗證成功都顯示結果
            perform(xDocument);
            //}
            fileStream.Close();
        }
Exemple #2
0
        /// <summary>
        /// 驗證Cap檔案
        /// </summary>
        /// <returns>驗證結果</returns>
        public static List <CapValidateResult> Validate(string filePath)
        {
            // var fileStream = File.OpenRead(filePath);

            using (var fileStream = System.IO.File.OpenRead(filePath)) {
                XDocument xDocument = XDocument.Load(fileStream);
                return(CapValidator.Validate(xDocument));
            }

            /*
             * var fileStream = File.OpenRead(filePath);
             * XDocument xDocument = XDocument.Load(fileStream);
             * return CapValidator.Validate(xDocument);
             */
        }
Exemple #3
0
 /// <summary>
 /// 驗證CapDocument物件
 /// </summary>
 /// <returns>驗證結果</returns>
 public List <CapValidateResult> Validate()
 {
     return(CapValidator.Validate(this));
 }