Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridCell.cs / 1 / DataGridCell.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System;
using System.Globalization;
///
///
/// Identifies a cell in the grid.
///
[SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
public struct DataGridCell {
private int rowNumber;
private int columnNumber;
///
///
/// Gets or sets the number of a column in the control.
///
public int ColumnNumber {
get {
return columnNumber;
}
set {
columnNumber = value;
}
}
///
///
/// Gets or sets the number of a row in the control.
///
public int RowNumber {
get {
return rowNumber;
}
set {
rowNumber = value;
}
}
///
///
///
/// Initializes a new instance of the class.
///
///
public DataGridCell(int r, int c) {
this.rowNumber = r;
this.columnNumber = c;
}
///
///
///
/// Gets a value indicating whether the is identical to a second
/// .
///
///
[SuppressMessage("Microsoft.Usage", "CA2231:OverrideOperatorEqualsOnOverridingValueTypeEquals")]
public override bool Equals(object o) {
if (o is DataGridCell) {
DataGridCell rhs = (DataGridCell)o;
return (rhs.RowNumber == RowNumber && rhs.ColumnNumber == ColumnNumber);
}
else
return false;
}
///
///
///
/// Gets
/// a hash value that uniquely identifies the cell.
///
///
public override int GetHashCode() {
return ((~rowNumber * (columnNumber+1)) & 0x00ffff00) >> 8;
}
///
///
///
/// Gets the row number and column number of the cell.
///
///
public override string ToString() {
return "DataGridCell {RowNumber = " + RowNumber.ToString(CultureInfo.CurrentCulture) +
", ColumnNumber = " + ColumnNumber.ToString(CultureInfo.CurrentCulture) + "}";
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System;
using System.Globalization;
///
///
/// Identifies a cell in the grid.
///
[SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
public struct DataGridCell {
private int rowNumber;
private int columnNumber;
///
///
/// Gets or sets the number of a column in the control.
///
public int ColumnNumber {
get {
return columnNumber;
}
set {
columnNumber = value;
}
}
///
///
/// Gets or sets the number of a row in the control.
///
public int RowNumber {
get {
return rowNumber;
}
set {
rowNumber = value;
}
}
///
///
///
/// Initializes a new instance of the class.
///
///
public DataGridCell(int r, int c) {
this.rowNumber = r;
this.columnNumber = c;
}
///
///
///
/// Gets a value indicating whether the is identical to a second
/// .
///
///
[SuppressMessage("Microsoft.Usage", "CA2231:OverrideOperatorEqualsOnOverridingValueTypeEquals")]
public override bool Equals(object o) {
if (o is DataGridCell) {
DataGridCell rhs = (DataGridCell)o;
return (rhs.RowNumber == RowNumber && rhs.ColumnNumber == ColumnNumber);
}
else
return false;
}
///
///
///
/// Gets
/// a hash value that uniquely identifies the cell.
///
///
public override int GetHashCode() {
return ((~rowNumber * (columnNumber+1)) & 0x00ffff00) >> 8;
}
///
///
///
/// Gets the row number and column number of the cell.
///
///
public override string ToString() {
return "DataGridCell {RowNumber = " + RowNumber.ToString(CultureInfo.CurrentCulture) +
", ColumnNumber = " + ColumnNumber.ToString(CultureInfo.CurrentCulture) + "}";
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FormsAuthenticationUser.cs
- MatrixAnimationUsingPath.cs
- SimpleExpression.cs
- XhtmlBasicLinkAdapter.cs
- TagNameToTypeMapper.cs
- PropertyEntry.cs
- DocumentDesigner.cs
- ThreadAttributes.cs
- SQLSingle.cs
- UnmanagedMemoryAccessor.cs
- StringPropertyBuilder.cs
- PnrpPermission.cs
- UniformGrid.cs
- SqlNodeAnnotations.cs
- SoapDocumentMethodAttribute.cs
- ElapsedEventArgs.cs
- ToolboxItemCollection.cs
- XPathItem.cs
- sqlser.cs
- CompilationUtil.cs
- SiteOfOriginPart.cs
- MulticastIPAddressInformationCollection.cs
- PackageDigitalSignatureManager.cs
- AssemblyInfo.cs
- NullableFloatMinMaxAggregationOperator.cs
- CodeSnippetExpression.cs
- CacheForPrimitiveTypes.cs
- NonSerializedAttribute.cs
- TcpChannelListener.cs
- CreateWorkflowOwnerCommand.cs
- ExtensionFile.cs
- ModifierKeysValueSerializer.cs
- NetSectionGroup.cs
- WebProxyScriptElement.cs
- CodeExporter.cs
- UDPClient.cs
- EditorPart.cs
- VisualStyleRenderer.cs
- StdValidatorsAndConverters.cs
- XmlSchemaObjectCollection.cs
- GenericEnumConverter.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- XmlDownloadManager.cs
- SerTrace.cs
- Buffer.cs
- TraceInternal.cs
- UserPreferenceChangingEventArgs.cs
- WinFormsSecurity.cs
- QueryConverter.cs
- CqlLexerHelpers.cs
- Int64Animation.cs
- XmlKeywords.cs
- ContentType.cs
- ExcCanonicalXml.cs
- SectionRecord.cs
- WSDualHttpSecurityElement.cs
- NotificationContext.cs
- DataControlLinkButton.cs
- PartialTrustHelpers.cs
- DictionaryEntry.cs
- QuadraticBezierSegment.cs
- SpnEndpointIdentity.cs
- ConditionValidator.cs
- TextDecorationUnitValidation.cs
- Vector3dCollection.cs
- Propagator.Evaluator.cs
- SQLInt16.cs
- EncoderParameters.cs
- PKCS1MaskGenerationMethod.cs
- GenerateDerivedKeyRequest.cs
- ToolStripComboBox.cs
- CheckableControlBaseAdapter.cs
- DataBoundControl.cs
- SqlSelectStatement.cs
- RadialGradientBrush.cs
- CustomError.cs
- ConfigsHelper.cs
- CodeCompiler.cs
- AbsoluteQuery.cs
- BamlReader.cs
- NameObjectCollectionBase.cs
- BlurBitmapEffect.cs
- StrokeCollectionConverter.cs
- ObjectStateFormatter.cs
- FixedHyperLink.cs
- NoClickablePointException.cs
- xmlglyphRunInfo.cs
- StdValidatorsAndConverters.cs
- DataKey.cs
- WebHttpBinding.cs
- TabPanel.cs
- RepeatInfo.cs
- DataObjectAttribute.cs
- SetterBaseCollection.cs
- BoundPropertyEntry.cs
- ServiceDesigner.cs
- WebBrowserBase.cs
- StatusBar.cs
- SecurityTokenException.cs
- GeneralTransformGroup.cs