/// <summary>
        /// Handles the Load event of the ValidationOutputForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ValidationOutputForm_Load(object sender, EventArgs e)
        {
            //  Create the XSD validator.
            var validator = new XsdValidator();

            validator.Validate(XsdFilePath, XmlFilePaths);

            //  Lock the list view for update.
            listViewXSDValidation.BeginUpdate();

            //  Go through each file path.
            foreach (var filePath in validator.ValidationMessages.Keys)
            {
                //  Get the name.
                string fileName;
                try
                {
                    fileName = Path.GetFileName(filePath);
                }
                catch
                {
                    fileName = filePath;
                }

                //  Go through the messages, adding each to the list view.
                foreach (var message in validator.ValidationMessages[filePath])
                {
                    AddValidationMessageToListView(fileName, message);
                }
            }

            //  Release the list view for update.
            listViewXSDValidation.EndUpdate();
        }
예제 #2
0
        /// <summary>
        /// Handles the Load event of the ValidationOutputForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ValidationOutputForm_Load(object sender, EventArgs e)
        {
            //  Create the XSD validator.
            var validator = new XsdValidator();
            validator.Validate(XsdFilePath, XmlFilePaths);

            //  Lock the list view for update.
            listViewXSDValidation.BeginUpdate();

            //  Go through each file path.
            foreach (var filePath in validator.ValidationMessages.Keys)
            {
                //  Get the name.
                string fileName;
                try
                {
                    fileName = Path.GetFileName(filePath);
                }
                catch
                {
                    fileName = filePath;
                }

                //  Go through the messages, adding each to the list view.
                foreach (var message in validator.ValidationMessages[filePath])
                    AddValidationMessageToListView(fileName, message);
            }

            //  Release the list view for update.
            listViewXSDValidation.EndUpdate();
        }