Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewTopRowAccessibleObject.cs / 1 / DataGridViewTopRowAccessibleObject.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Security.Permissions; using System.Drawing; using System.Diagnostics; namespace System.Windows.Forms { public partial class DataGridView { ///[ System.Runtime.InteropServices.ComVisible(true) ] protected class DataGridViewTopRowAccessibleObject : AccessibleObject { DataGridView owner; /// public DataGridViewTopRowAccessibleObject() : base() { } /// public DataGridViewTopRowAccessibleObject(DataGridView owner) : base() { this.owner = owner; } /// public override Rectangle Bounds { get { if (this.owner == null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerNotSet)); } if (this.owner.ColumnHeadersVisible) { Rectangle rect = Rectangle.Union(this.owner.layout.ColumnHeaders, this.owner.layout.TopLeftHeader); return this.owner.RectangleToScreen(rect); } else { return Rectangle.Empty; } } } /// public override string Name { get { return SR.GetString(SR.DataGridView_AccTopRow); } } /// public DataGridView Owner { get { return this.owner; } set { if (this.owner != null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerAlreadySet)); } this.owner = value; } } /// public override AccessibleObject Parent { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { if (this.owner == null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerNotSet)); } return this.owner.AccessibilityObject; } } /// public override AccessibleRole Role { get { return AccessibleRole.Row; } } /// public override string Value { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { return this.Name; } } /// public override AccessibleObject GetChild(int index) { if (this.owner == null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerNotSet)); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } if (index == 0 && this.owner.RowHeadersVisible) { return this.owner.TopLeftHeaderCell.AccessibilityObject; } if (this.owner.RowHeadersVisible) { // decrement the index because the first child is the top left header cell index --; } Debug.Assert(index >= 0); if (index < this.owner.Columns.GetColumnCount(DataGridViewElementStates.Visible)) { int actualColumnIndex = this.owner.Columns.ActualDisplayIndexToColumnIndex(index, DataGridViewElementStates.Visible); return this.owner.Columns[actualColumnIndex].HeaderCell.AccessibilityObject; } else { return null; } } /// public override int GetChildCount() { if (this.owner == null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerNotSet)); } int result = this.owner.Columns.GetColumnCount(DataGridViewElementStates.Visible); if (this.owner.RowHeadersVisible) { // + 1 is the top left header cell accessibility object result ++; } return result; } /// [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public override AccessibleObject Navigate(AccessibleNavigation navigationDirection) { if (this.owner == null) { throw new InvalidOperationException(SR.GetString(SR.DataGridViewTopRowAccessibleObject_OwnerNotSet)); } switch (navigationDirection) { case AccessibleNavigation.Down: case AccessibleNavigation.Next: if (this.owner.AccessibilityObject.GetChildCount() > 1) { return this.owner.AccessibilityObject.GetChild(1); } else { return null; } case AccessibleNavigation.FirstChild: return this.GetChild(0); case AccessibleNavigation.LastChild: return this.GetChild(this.GetChildCount() - 1); default: return null; } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Rect3DValueSerializer.cs
- Int16.cs
- TextParentUndoUnit.cs
- Regex.cs
- AdapterUtil.cs
- AutomationAttributeInfo.cs
- DataGridBoolColumn.cs
- EnumConverter.cs
- _NestedMultipleAsyncResult.cs
- HelpEvent.cs
- _NativeSSPI.cs
- HashMembershipCondition.cs
- XmlQualifiedName.cs
- TraceHandler.cs
- RangeValidator.cs
- TickBar.cs
- CollectionViewGroupInternal.cs
- EastAsianLunisolarCalendar.cs
- filewebrequest.cs
- NativeObjectSecurity.cs
- NonClientArea.cs
- DesignerDataTableBase.cs
- ListViewUpdatedEventArgs.cs
- CompoundFileReference.cs
- CatalogPartDesigner.cs
- ErrorTableItemStyle.cs
- Hashtable.cs
- WebEventTraceProvider.cs
- AutomationPatternInfo.cs
- AnnotationDocumentPaginator.cs
- HtmlInputImage.cs
- DataControlButton.cs
- PropertyDescriptorCollection.cs
- CanonicalXml.cs
- EnvironmentPermission.cs
- ReadOnlyCollectionBase.cs
- PrintDialog.cs
- DetailsViewRow.cs
- GridView.cs
- SQLBinary.cs
- TextDpi.cs
- EventLogPermissionEntryCollection.cs
- DeferredSelectedIndexReference.cs
- MimeWriter.cs
- XmlEncoding.cs
- NativeMethods.cs
- FormatException.cs
- HttpListenerRequest.cs
- HelloMessageCD1.cs
- RequestSecurityToken.cs
- X509ChainElement.cs
- EntityDataSourceStatementEditorForm.cs
- VSWCFServiceContractGenerator.cs
- ToolStripItemDataObject.cs
- DependencyProperty.cs
- SafeProcessHandle.cs
- SecurityHelper.cs
- XmlCharacterData.cs
- ReservationNotFoundException.cs
- CompilerCollection.cs
- FileDetails.cs
- CacheAxisQuery.cs
- SerializationSectionGroup.cs
- ByteFacetDescriptionElement.cs
- PathTooLongException.cs
- DockPattern.cs
- StickyNoteAnnotations.cs
- AttributeAction.cs
- UnaryExpressionHelper.cs
- ToolStripItemTextRenderEventArgs.cs
- AdornerHitTestResult.cs
- PngBitmapEncoder.cs
- keycontainerpermission.cs
- SafeMemoryMappedViewHandle.cs
- BuildProviderAppliesToAttribute.cs
- DataExpression.cs
- UnsafeNativeMethods.cs
- XPathDocumentNavigator.cs
- MaskedTextBoxDesignerActionList.cs
- ListViewDeleteEventArgs.cs
- StubHelpers.cs
- WindowProviderWrapper.cs
- DataRelation.cs
- SvcMapFile.cs
- glyphs.cs
- XmlReflectionImporter.cs
- VirtualDirectoryMappingCollection.cs
- StringUtil.cs
- TileModeValidation.cs
- remotingproxy.cs
- Geometry3D.cs
- PeerName.cs
- CheckPair.cs
- FixedLineResult.cs
- __TransparentProxy.cs
- VisualStyleTypesAndProperties.cs
- StorageModelBuildProvider.cs
- ValidatingReaderNodeData.cs
- XPathConvert.cs
- RenderData.cs