Code:
/ FX-1434 / FX-1434 / 1.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
- XmlSchemaCollection.cs
- IOException.cs
- Buffer.cs
- GiveFeedbackEvent.cs
- CodeExpressionCollection.cs
- ISO2022Encoding.cs
- PlanCompilerUtil.cs
- PixelShader.cs
- EncoderBestFitFallback.cs
- SecurityChannelListener.cs
- ProjectionPruner.cs
- ConfigXmlText.cs
- SqlExpander.cs
- TcpConnectionPool.cs
- XComponentModel.cs
- ObjectDataSourceMethodEventArgs.cs
- ContractMapping.cs
- DbParameterCollection.cs
- TerminateSequenceResponse.cs
- D3DImage.cs
- ArraySubsetEnumerator.cs
- PolyLineSegment.cs
- RangeValuePatternIdentifiers.cs
- PipelineModuleStepContainer.cs
- LinearGradientBrush.cs
- WebEvents.cs
- GeneralTransform3DGroup.cs
- Utils.cs
- CompositeActivityMarkupSerializer.cs
- XhtmlMobileTextWriter.cs
- XmlComment.cs
- IsolatedStoragePermission.cs
- ActivitiesCollection.cs
- StringKeyFrameCollection.cs
- Set.cs
- CurrentChangedEventManager.cs
- ImpersonateTokenRef.cs
- DataServiceQueryProvider.cs
- StickyNoteHelper.cs
- GlobalItem.cs
- EnumValidator.cs
- ProtocolsSection.cs
- InputQueueChannelAcceptor.cs
- ImageList.cs
- MultipartContentParser.cs
- BitmapScalingModeValidation.cs
- TextServicesProperty.cs
- OLEDB_Enum.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- MultiByteCodec.cs
- TimeoutConverter.cs
- PowerModeChangedEventArgs.cs
- ProxyManager.cs
- StructuredTypeEmitter.cs
- ActivityDesignerAccessibleObject.cs
- ConfigViewGenerator.cs
- ItemDragEvent.cs
- StringWriter.cs
- RequestCacheEntry.cs
- SqlProviderManifest.cs
- XmlLoader.cs
- IndicFontClient.cs
- DataGridViewColumnConverter.cs
- Merger.cs
- ReferenceService.cs
- FeatureManager.cs
- codemethodreferenceexpression.cs
- MailAddressCollection.cs
- DataSourceView.cs
- QuaternionConverter.cs
- GAC.cs
- RMPermissions.cs
- EncryptedPackage.cs
- ProvidersHelper.cs
- DbException.cs
- ConnectionManagementElement.cs
- PackagePartCollection.cs
- HtmlInputReset.cs
- MaskedTextProvider.cs
- ProcessModuleCollection.cs
- DataGridTextBox.cs
- WriteableOnDemandPackagePart.cs
- CacheForPrimitiveTypes.cs
- AdjustableArrowCap.cs
- HtmlInputPassword.cs
- XmlDsigSep2000.cs
- BaseAppDomainProtocolHandler.cs
- CodeDirectiveCollection.cs
- GenericPrincipal.cs
- CompiledQuery.cs
- WebPartHelpVerb.cs
- SiteMapHierarchicalDataSourceView.cs
- DynamicArgumentDesigner.xaml.cs
- ToolBar.cs
- UnsafeNativeMethods.cs
- TableSectionStyle.cs
- SqlWebEventProvider.cs
- XmlElementAttributes.cs
- TraceLog.cs
- StringValidatorAttribute.cs