示例#1
0
 public void UpdateUI(ValidationReport report)
 {
     this.listView.BeginUpdate();
     this.listView.Items.Clear();
     if (report.IsValid)
     {
         for (int i = 0; i < report.Count; i++)
         {
             ValidationRecord validationRecord = report[i];
             int imageIndex;
             if (validationRecord.Severity == ValidationRecord.Severities.Success)
             {
                 imageIndex = 0;
             }
             else
             {
                 if (validationRecord.Severity == ValidationRecord.Severities.Warning)
                 {
                     imageIndex = 1;
                 }
                 else
                 {
                     imageIndex = 2;
                 }
             }
             ListViewItem listViewItem = new ListViewItem(validationRecord.Message, imageIndex);
             listViewItem.Tag = validationRecord;
             this.listView.Items.Add(listViewItem);
         }
     }
     this.listView.EndUpdate();
 }
示例#2
0
        private void listView_Click(object sender, EventArgs e)
        {
            if (this.listView.SelectedItems.Count == 0)
            {
                return;
            }
            ListViewItem listViewItem = this.listView.SelectedItems[0];

            if (listViewItem.Tag is ValidationRecord)
            {
                ValidationRecord validationRecord = (ValidationRecord)listViewItem.Tag;
                EditorObject     arg_44_0         = validationRecord.Object;
                if (validationRecord.Object.IsValid)
                {
                    Camera.Focus(validationRecord.Object);
                }
            }
        }