コード例 #1
0
        /// <summary>
        /// Adds the validation message to the list view.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="validationMessage">The validation message.</param>
        private void AddValidationMessageToListView(string fileName, ValidationMessage validationMessage)
        {
            //  Create the image list index.
            var imageIndex = 0;
            switch (validationMessage.ValidationType)
            {
                case ValidationType.Success:
                    imageIndex = ImageList_Index_Success;
                    break;
                case ValidationType.Warning:
                    imageIndex = ImageList_Index_Warning;
                    break;
                case ValidationType.Error:
                    imageIndex = ImageList_Index_Error;
                    break;
            }

            //  Add the list view item with the appropriate icon index.
            listViewXSDValidation.Items.Add(new ListViewItem(new[] { fileName, validationMessage.Message },
                imageIndex));
        }