1
// ****************************************************************
2
// This is free software licensed under the NUnit license. You may
3
// obtain a copy of the license at http://nunit.org
4
// ****************************************************************
7
using System.Collections.Generic;
11
namespace NUnit.UiException.Controls
14
/// Encapsulate data to draw a line of text.
16
public class PaintLineLocation
19
/// Index of the current line.
21
private int _lineIndex;
24
/// The string value at this line.
29
/// A client coordinate from where beginning the drawing.
31
private PointF _location;
34
/// Build a new instance of this object given some data.
36
/// <param name="lineIndex">Index of the current line.</param>
37
/// <param name="text">String value at this line.</param>
38
/// <param name="location">Client coordinate where beginning the drawing.</param>
39
public PaintLineLocation(int lineIndex, string text, PointF location)
43
SetLocation(location);
49
/// Index of the current line.
53
get { return (_lineIndex); }
57
/// String value at this line.
61
get { return (_text); }
65
/// Client coordinate where to beginning the drawing.
67
public PointF Location
69
get { return (_location); }
72
public override bool Equals(object obj)
74
PaintLineLocation line;
77
!(obj is PaintLineLocation))
80
line = obj as PaintLineLocation;
82
return (line.LineIndex == LineIndex &&
84
line.Location == Location);
87
public override int GetHashCode() {
88
return base.GetHashCode();
91
public override string ToString() {
92
return ("PaintLineLocation: {" + LineIndex + ":[" + Text + "]:(" +
93
Location.X + ", " + Location.Y + ")}");
96
#region private definitions
98
protected void SetLine(int lineIndex)
100
_lineIndex = lineIndex;
105
protected void SetText(string text)
107
UiExceptionHelper.CheckNotNull(text, "text");
111
protected void SetLocation(PointF location) {
112
_location = location;
1
// ****************************************************************
2
// This is free software licensed under the NUnit license. You may
3
// obtain a copy of the license at http://nunit.org
4
// ****************************************************************
7
using System.Collections.Generic;
11
namespace NUnit.UiException.Controls
14
/// Encapsulate data to draw a line of text.
16
public class PaintLineLocation
19
/// Index of the current line.
21
private int _lineIndex;
24
/// The string value at this line.
29
/// A client coordinate from where beginning the drawing.
31
private PointF _location;
34
/// Build a new instance of this object given some data.
36
/// <param name="lineIndex">Index of the current line.</param>
37
/// <param name="text">String value at this line.</param>
38
/// <param name="location">Client coordinate where beginning the drawing.</param>
39
public PaintLineLocation(int lineIndex, string text, PointF location)
43
SetLocation(location);
49
/// Index of the current line.
53
get { return (_lineIndex); }
57
/// String value at this line.
61
get { return (_text); }
65
/// Client coordinate where to beginning the drawing.
67
public PointF Location
69
get { return (_location); }
72
public override bool Equals(object obj)
74
PaintLineLocation line;
77
!(obj is PaintLineLocation))
80
line = obj as PaintLineLocation;
82
return (line.LineIndex == LineIndex &&
84
line.Location == Location);
87
public override int GetHashCode() {
88
return base.GetHashCode();
91
public override string ToString() {
92
return ("PaintLineLocation: {" + LineIndex + ":[" + Text + "]:(" +
93
Location.X + ", " + Location.Y + ")}");
96
#region private definitions
98
protected void SetLine(int lineIndex)
100
_lineIndex = lineIndex;
105
protected void SetText(string text)
107
UiExceptionHelper.CheckNotNull(text, "text");
111
protected void SetLocation(PointF location) {
112
_location = location;