(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / DataGridCell.cs
blob5d1da1ff9ce5395bacecf277810002ddef702ea2
1 //
2 // System.Windows.Forms.DataGridCell.cs
3 //
4 // Author:
5 // Dennis Hayes (dennish@raytek.com)
6 //
7 // (C) 2002 Ximian, Inc. http://www.ximian.com
8 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System;
33 namespace System.Windows.Forms {
35 public struct DataGridCell {
37 private int rownumber;
38 private int columnnumber;
40 // -----------------------
41 // Public Constructor
42 // -----------------------
44 /// <summary>
45 ///
46 /// </summary>
47 ///
48 /// <remarks>
49 ///
50 /// </remarks>
52 public DataGridCell (int r, int c)
54 rownumber = r;
55 columnnumber = c;
58 // -----------------------
59 // Public Shared Members
60 // -----------------------
62 /// <remarks>
63 /// Compares two DataGridCell objects. The return value is
64 /// based on the equivalence of the RowNumber and ColumnNumber properties of the two objects.
65 /// </remarks>
67 public static bool operator == (DataGridCell dgc_a,
68 DataGridCell dgc_b) {
70 return ((dgc_a.rownumber == dgc_b.rownumber) &&
71 (dgc_a.columnnumber == dgc_b.columnnumber));
74 /// <summary>
75 /// Inequality Operator
76 /// </summary>
77 ///
78 /// <remarks>
79 /// Compares two DataGridCell objects. The return value is
80 /// based on the equivalence of the RowNumber and ColumnNumber properties of the two objects.
81 /// </remarks>
82 public static bool operator != (DataGridCell dgc_a,
83 DataGridCell dgc_b) {
84 return ((dgc_a.rownumber != dgc_b.rownumber) ||
85 (dgc_a.columnnumber != dgc_b.columnnumber));
88 // -----------------------
89 // Public Instance Members
90 // -----------------------
93 public int RowNumber {
94 get{
95 return rownumber;
97 set{
98 rownumber = value;
102 public int ColumnNumber {
103 get{
104 return columnnumber;
106 set{
107 columnnumber = value;
111 /// <summary>
112 /// Equals Method
113 /// </summary>
115 /// <remarks>
116 /// Checks equivalence of this DataGridCell and another object.
117 /// </remarks>
119 public override bool Equals (object o)
121 if (!(o is DataGridCell))
122 return false;
124 return (this == (DataGridCell) o);
127 /// <summary>
128 /// GetHashCode Method
129 /// </summary>
131 /// <remarks>
132 /// Calculates a hashing value.
133 /// </remarks>
135 public override int GetHashCode ()
137 return (int)( rownumber ^ columnnumber);
140 /// <summary>
141 /// ToString Method
142 /// </summary>
144 /// <remarks>
145 /// Formats the DataGridCell as a string.
146 /// </remarks>
148 public override string ToString ()
150 return String.Format ("[{0},{1}]", rownumber, columnnumber );