Ejemplo n.º 1
0
        private void detailList_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
        {
            TestResultItem item = (TestResultItem)detailList.Items[e.Index];
            string         s    = item.ToString();
            SizeF          size = this.WordWrap
                ? e.Graphics.MeasureString(item.ToString(), detailList.Font, detailList.ClientSize.Width)
                : e.Graphics.MeasureString(item.ToString(), detailList.Font);

            e.ItemHeight = (int)size.Height;
            e.ItemWidth  = (int)size.Width;
        }
Ejemplo n.º 2
0
 private void detailList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
 {
     if (e.Index >= 0)
     {
         e.DrawBackground();
         TestResultItem item  = (TestResultItem)detailList.Items[e.Index];
         Brush          brush = (e.State & DrawItemState.Selected) == DrawItemState.Selected
             ? SystemBrushes.HighlightText
             : SystemBrushes.WindowText;
         e.Graphics.DrawString(item.ToString(), detailList.Font, brush, e.Bounds.Left, e.Bounds.Top + ITEM_MARGIN);
     }
 }
Ejemplo n.º 3
0
        private void detailList_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
        {
            TestResultItem item = (TestResultItem)detailList.Items[e.Index];
            SizeF          size = e.Graphics.MeasureString(item.ToString(), detailList.Font);

            e.ItemHeight = (int)size.Height + 2 * ITEM_MARGIN;
            e.ItemWidth  = (int)size.Width;
            if (e.ItemWidth > detailList.HorizontalExtent)
            {
                detailList.HorizontalExtent = e.ItemWidth;
            }
        }
Ejemplo n.º 4
0
 private void detailList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
 {
     if (e.Index >= 0)
     {
         e.DrawBackground();
         TestResultItem item       = (TestResultItem)detailList.Items[e.Index];
         bool           selected   = ((e.State & DrawItemState.Selected) == DrawItemState.Selected) ? true : false;
         Brush          brush      = selected ? SystemBrushes.HighlightText : SystemBrushes.WindowText;
         RectangleF     layoutRect = e.Bounds;
         if (this.WordWrap && layoutRect.Width > detailList.ClientSize.Width)
         {
             layoutRect.Width = detailList.ClientSize.Width;
         }
         e.Graphics.DrawString(item.ToString(), detailList.Font, brush, layoutRect);
     }
 }
Ejemplo n.º 5
0
        public void ToStringTest(string message, string stackTrace)
        {
            var item = new TestResultItem("dummy test name", message, stackTrace);

            Assert.IsNotNull(item.ToString());
        }