Пример #1
0
 private void UpdateItem(TreeViewItem item)
 {
     bool is_executed = false, is_failed = false;
     if (item.Tag is TestcaseView)
     {
         var testcase = item.Tag as TestcaseView;
         is_executed = testcase.IsExecuted;
         is_failed = testcase.Failed;
     }
     else if (item.Tag is TestFixtureView)
     {
         var fixture = item.Tag as TestFixtureView;
         is_executed = fixture.AreAllExecuted;
         is_failed = fixture.HasAnyFailures;
     }
     if (is_failed)
     {
         item.ExpandUpRecursive();
         item.BringIntoView();
         //((item.Header as StackPanel).Children[0] as Image).Source = red_icon;
         //(item.Header as TextBlock).
         item.Foreground = Brushes.Red;
         //m_textbox2.Text = testcase.Exception.PrettyPrint();
         //m_textbox1.Text = testcase.ToString() + " --> FAILED:\n\n" + testcase.Exception.Message;
         //string s = testcase.Exception.PrettyPrint();
     }
     else if (is_executed)
     {
         item.Foreground = Brushes.Black;
     }
     else
         item.Foreground = Brushes.DarkGray;
 }