~ubuntu-branches/debian/sid/nunit/sid

« back to all changes in this revision

Viewing changes to src/GuiException/UiException/Controls/PaintLineLocation.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2014-09-16 13:43:36 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140916134336-kjxz48tty6lx2ja5
Tags: 2.6.3+dfsg-1
* [c7bd1b5] Imported Upstream version 2.6.3+dfsg
* [bcb4bf8] Move nunit-console-runner to GAC-installed libnunit2.6, 
  don't treat it as a private lib. This lib is signed, and treated 
  as a GAC lib by consumers such as MonoDevelop.
* [7f08e99] Bump version to 2.6.3 as required
* [84535eb] Refreshed patches
* [8479f61] Split package up into per-assembly packages. This makes 
  ABI tracking easier in the future, as we can meaningfully have GAC 
  policy for cases where ABI isn't truly bumped, and no policy for 
  cases where it is. For example, if nunit.framework bumps ABI but 
  nunit.core does not, previously we would need to rebuild everything 
  using NUnit, but under the new split packaging, that rebuild would 
  not be needed for apps only using nunit.core.
* [17a7dc7] Add missing nunit.mocks.dll to nunit.pc

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
// ****************************************************************
5
 
 
6
 
using System;
7
 
using System.Collections.Generic;
8
 
using System.Text;
9
 
using System.Drawing;
10
 
 
11
 
namespace NUnit.UiException.Controls
12
 
{
13
 
    /// <summary>
14
 
    /// Encapsulate data to draw a line of text.
15
 
    /// </summary>
16
 
    public class PaintLineLocation
17
 
    {
18
 
        /// <summary>
19
 
        /// Index of the current line.
20
 
        /// </summary>
21
 
        private int _lineIndex;
22
 
 
23
 
        /// <summary>
24
 
        /// The string value at this line.
25
 
        /// </summary>
26
 
        private string _text;
27
 
 
28
 
        /// <summary>
29
 
        /// A client coordinate from where beginning the drawing.
30
 
        /// </summary>
31
 
        private PointF _location;        
32
 
 
33
 
        /// <summary>
34
 
        /// Build a new instance of this object given some data.
35
 
        /// </summary>
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)
40
 
        {
41
 
            SetLine(lineIndex);
42
 
            SetText(text);
43
 
            SetLocation(location);
44
 
 
45
 
            return;
46
 
        }
47
 
 
48
 
        /// <summary>
49
 
        /// Index of the current line.
50
 
        /// </summary>
51
 
        public int LineIndex
52
 
        {
53
 
            get { return (_lineIndex); }
54
 
        }
55
 
 
56
 
        /// <summary>
57
 
        /// String value at this line.
58
 
        /// </summary>
59
 
        public string Text
60
 
        {
61
 
            get { return (_text); }
62
 
        }
63
 
 
64
 
        /// <summary>
65
 
        /// Client coordinate where to beginning the drawing.
66
 
        /// </summary>
67
 
        public PointF Location
68
 
        {
69
 
            get { return (_location); }
70
 
        }
71
 
       
72
 
        public override bool Equals(object obj)
73
 
        {
74
 
            PaintLineLocation line;
75
 
 
76
 
            if (obj == null ||
77
 
                !(obj is PaintLineLocation))
78
 
                return (false);
79
 
 
80
 
            line = obj as PaintLineLocation;
81
 
 
82
 
            return (line.LineIndex == LineIndex &&
83
 
                line.Text == Text &&
84
 
                line.Location == Location);
85
 
        }
86
 
 
87
 
        public override int GetHashCode() {
88
 
            return base.GetHashCode();
89
 
        }
90
 
 
91
 
        public override string ToString() {
92
 
            return ("PaintLineLocation: {" + LineIndex + ":[" + Text + "]:(" +
93
 
                     Location.X + ", " + Location.Y + ")}");
94
 
        }
95
 
 
96
 
        #region private definitions
97
 
 
98
 
        protected void SetLine(int lineIndex)
99
 
        {
100
 
            _lineIndex = lineIndex;
101
 
 
102
 
            return;
103
 
        }
104
 
 
105
 
        protected void SetText(string text) 
106
 
        {
107
 
            UiExceptionHelper.CheckNotNull(text, "text");
108
 
            _text = text;
109
 
        }
110
 
 
111
 
        protected void SetLocation(PointF location) {
112
 
            _location = location;
113
 
        }
114
 
 
115
 
        #endregion
116
 
    }
117
 
}
 
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
// ****************************************************************
 
5
 
 
6
using System;
 
7
using System.Collections.Generic;
 
8
using System.Text;
 
9
using System.Drawing;
 
10
 
 
11
namespace NUnit.UiException.Controls
 
12
{
 
13
    /// <summary>
 
14
    /// Encapsulate data to draw a line of text.
 
15
    /// </summary>
 
16
    public class PaintLineLocation
 
17
    {
 
18
        /// <summary>
 
19
        /// Index of the current line.
 
20
        /// </summary>
 
21
        private int _lineIndex;
 
22
 
 
23
        /// <summary>
 
24
        /// The string value at this line.
 
25
        /// </summary>
 
26
        private string _text;
 
27
 
 
28
        /// <summary>
 
29
        /// A client coordinate from where beginning the drawing.
 
30
        /// </summary>
 
31
        private PointF _location;        
 
32
 
 
33
        /// <summary>
 
34
        /// Build a new instance of this object given some data.
 
35
        /// </summary>
 
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)
 
40
        {
 
41
            SetLine(lineIndex);
 
42
            SetText(text);
 
43
            SetLocation(location);
 
44
 
 
45
            return;
 
46
        }
 
47
 
 
48
        /// <summary>
 
49
        /// Index of the current line.
 
50
        /// </summary>
 
51
        public int LineIndex
 
52
        {
 
53
            get { return (_lineIndex); }
 
54
        }
 
55
 
 
56
        /// <summary>
 
57
        /// String value at this line.
 
58
        /// </summary>
 
59
        public string Text
 
60
        {
 
61
            get { return (_text); }
 
62
        }
 
63
 
 
64
        /// <summary>
 
65
        /// Client coordinate where to beginning the drawing.
 
66
        /// </summary>
 
67
        public PointF Location
 
68
        {
 
69
            get { return (_location); }
 
70
        }
 
71
       
 
72
        public override bool Equals(object obj)
 
73
        {
 
74
            PaintLineLocation line;
 
75
 
 
76
            if (obj == null ||
 
77
                !(obj is PaintLineLocation))
 
78
                return (false);
 
79
 
 
80
            line = obj as PaintLineLocation;
 
81
 
 
82
            return (line.LineIndex == LineIndex &&
 
83
                line.Text == Text &&
 
84
                line.Location == Location);
 
85
        }
 
86
 
 
87
        public override int GetHashCode() {
 
88
            return base.GetHashCode();
 
89
        }
 
90
 
 
91
        public override string ToString() {
 
92
            return ("PaintLineLocation: {" + LineIndex + ":[" + Text + "]:(" +
 
93
                     Location.X + ", " + Location.Y + ")}");
 
94
        }
 
95
 
 
96
        #region private definitions
 
97
 
 
98
        protected void SetLine(int lineIndex)
 
99
        {
 
100
            _lineIndex = lineIndex;
 
101
 
 
102
            return;
 
103
        }
 
104
 
 
105
        protected void SetText(string text) 
 
106
        {
 
107
            UiExceptionHelper.CheckNotNull(text, "text");
 
108
            _text = text;
 
109
        }
 
110
 
 
111
        protected void SetLocation(PointF location) {
 
112
            _location = location;
 
113
        }
 
114
 
 
115
        #endregion
 
116
    }
 
117
}