Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewHitTestInfo.cs / 1 / DataGridViewHitTestInfo.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Globalization;
namespace System.Windows.Forms
{
public partial class DataGridView
{
///
public sealed class HitTestInfo
{
internal DataGridViewHitTestType type = DataGridViewHitTestType.None;
//internal DataGridViewHitTestTypeCloseEdge edge = DataGridViewHitTestTypeCloseEdge.None;
internal DataGridViewHitTestTypeInternal typeInternal = DataGridViewHitTestTypeInternal.None;
internal int row;
internal int col;
internal int adjacentRow;
internal int adjacentCol;
internal int mouseBarOffset;
internal int rowStart;
internal int colStart;
///
///
/// Allows the object to inform you the
/// extent of the grid.
///
public static readonly HitTestInfo Nowhere = new HitTestInfo();
internal HitTestInfo()
{
this.type = DataGridViewHitTestType.None;
this.typeInternal = DataGridViewHitTestTypeInternal.None;
//this.edge = DataGridViewHitTestTypeCloseEdge.None;
this.row = this.col = -1;
this.rowStart = this.colStart = -1;
this.adjacentRow = this.adjacentCol = -1;
}
///
///
/// Gets the number of the clicked column.
///
public int ColumnIndex
{
get
{
return this.col;
}
}
///
///
/// Gets the
/// number of the clicked row.
///
public int RowIndex
{
get
{
return this.row;
}
}
///
///
/// Gets the left edge of the column.
///
public int ColumnX
{
get
{
return this.colStart;
}
}
///
///
/// Gets the top edge of the row.
///
public int RowY
{
get
{
return this.rowStart;
}
}
///
///
/// Gets the part of the control, other than the row or column, that was
/// clicked.
///
public DataGridViewHitTestType Type
{
get
{
return this.type;
}
}
///
///
/// Indicates whether two objects are identical.
///
public override bool Equals(object value)
{
HitTestInfo hti = value as HitTestInfo;
if (hti != null)
{
return (this.type == hti.type &&
this.row == hti.row &&
this.col == hti.col);
}
return false;
}
///
///
/// Gets the hash code for the instance.
///
public override int GetHashCode()
{
return WindowsFormsUtils.GetCombinedHashCodes((int) this.type,
this.row,
this.col);
}
///
///
/// Gets the type, column number and row number.
///
public override string ToString()
{
return "{ Type:" + type.ToString() + ", Column:" + col.ToString(CultureInfo.CurrentCulture) + ", Row:" + row.ToString(CultureInfo.CurrentCulture) + " }";
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Globalization;
namespace System.Windows.Forms
{
public partial class DataGridView
{
///
public sealed class HitTestInfo
{
internal DataGridViewHitTestType type = DataGridViewHitTestType.None;
//internal DataGridViewHitTestTypeCloseEdge edge = DataGridViewHitTestTypeCloseEdge.None;
internal DataGridViewHitTestTypeInternal typeInternal = DataGridViewHitTestTypeInternal.None;
internal int row;
internal int col;
internal int adjacentRow;
internal int adjacentCol;
internal int mouseBarOffset;
internal int rowStart;
internal int colStart;
///
///
/// Allows the object to inform you the
/// extent of the grid.
///
public static readonly HitTestInfo Nowhere = new HitTestInfo();
internal HitTestInfo()
{
this.type = DataGridViewHitTestType.None;
this.typeInternal = DataGridViewHitTestTypeInternal.None;
//this.edge = DataGridViewHitTestTypeCloseEdge.None;
this.row = this.col = -1;
this.rowStart = this.colStart = -1;
this.adjacentRow = this.adjacentCol = -1;
}
///
///
/// Gets the number of the clicked column.
///
public int ColumnIndex
{
get
{
return this.col;
}
}
///
///
/// Gets the
/// number of the clicked row.
///
public int RowIndex
{
get
{
return this.row;
}
}
///
///
/// Gets the left edge of the column.
///
public int ColumnX
{
get
{
return this.colStart;
}
}
///
///
/// Gets the top edge of the row.
///
public int RowY
{
get
{
return this.rowStart;
}
}
///
///
/// Gets the part of the control, other than the row or column, that was
/// clicked.
///
public DataGridViewHitTestType Type
{
get
{
return this.type;
}
}
///
///
/// Indicates whether two objects are identical.
///
public override bool Equals(object value)
{
HitTestInfo hti = value as HitTestInfo;
if (hti != null)
{
return (this.type == hti.type &&
this.row == hti.row &&
this.col == hti.col);
}
return false;
}
///
///
/// Gets the hash code for the instance.
///
public override int GetHashCode()
{
return WindowsFormsUtils.GetCombinedHashCodes((int) this.type,
this.row,
this.col);
}
///
///
/// Gets the type, column number and row number.
///
public override string ToString()
{
return "{ Type:" + type.ToString() + ", Column:" + col.ToString(CultureInfo.CurrentCulture) + ", Row:" + row.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
- TemplateBindingExpressionConverter.cs
- Image.cs
- XmlAnyElementAttributes.cs
- PreloadHost.cs
- MemoryMappedFile.cs
- IconConverter.cs
- CommandID.cs
- TemplateBindingExtension.cs
- SecurityResources.cs
- ActiveDocumentEvent.cs
- ExeContext.cs
- CurrencyManager.cs
- ChildTable.cs
- XPathNodeList.cs
- Variable.cs
- HttpListenerResponse.cs
- HotSpotCollection.cs
- CorrelationExtension.cs
- DispatcherProcessingDisabled.cs
- EllipseGeometry.cs
- DataKeyCollection.cs
- XDRSchema.cs
- TransformerConfigurationWizardBase.cs
- WindowsPen.cs
- TypeElement.cs
- BehaviorDragDropEventArgs.cs
- OptimizedTemplateContent.cs
- FileNotFoundException.cs
- FormsAuthenticationUserCollection.cs
- Size3DValueSerializer.cs
- SecurityPermission.cs
- OrderByBuilder.cs
- FixedHyperLink.cs
- HttpResponseInternalWrapper.cs
- MemberDescriptor.cs
- XmlProcessingInstruction.cs
- XPathSelectionIterator.cs
- CacheChildrenQuery.cs
- ButtonBase.cs
- PeerEndPoint.cs
- EventBookmark.cs
- Single.cs
- ConfigurationValidatorAttribute.cs
- HuffCodec.cs
- CngAlgorithmGroup.cs
- dbdatarecord.cs
- ToolStripPanelSelectionGlyph.cs
- PrincipalPermission.cs
- Button.cs
- PerformanceCounterCategory.cs
- AlphabeticalEnumConverter.cs
- SimplePropertyEntry.cs
- TextDecoration.cs
- TabletDeviceInfo.cs
- ELinqQueryState.cs
- DataGridTableStyleMappingNameEditor.cs
- ProtocolsSection.cs
- ProfileSection.cs
- VSWCFServiceContractGenerator.cs
- Convert.cs
- BaseComponentEditor.cs
- ArgumentException.cs
- TableAdapterManagerHelper.cs
- SiteMapDataSource.cs
- DynamicPropertyHolder.cs
- HtmlAnchor.cs
- IsolatedStorageException.cs
- ImageSourceConverter.cs
- AlphaSortedEnumConverter.cs
- Ray3DHitTestResult.cs
- QilLiteral.cs
- XmlAnyElementAttributes.cs
- RequestCacheEntry.cs
- XmlSchemaSequence.cs
- TableHeaderCell.cs
- FilterException.cs
- FormatVersion.cs
- WrapPanel.cs
- InputChannelBinder.cs
- CustomActivityDesigner.cs
- Propagator.Evaluator.cs
- BamlLocalizableResourceKey.cs
- ISO2022Encoding.cs
- RotateTransform3D.cs
- SiblingIterators.cs
- CharConverter.cs
- RangeValuePatternIdentifiers.cs
- ServiceSecurityAuditBehavior.cs
- XmlAnyAttributeAttribute.cs
- PlainXmlDeserializer.cs
- ProcessThread.cs
- LineSegment.cs
- WebPartEditorApplyVerb.cs
- ProviderBase.cs
- TripleDES.cs
- ListViewUpdateEventArgs.cs
- DesignerVerbToolStripMenuItem.cs
- DefinitionBase.cs
- SmiMetaDataProperty.cs
- ZipFileInfoCollection.cs