Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewSelectedCellsAccessibleObject.cs / 1305376 / DataGridViewSelectedCellsAccessibleObject.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Security.Permissions; namespace System.Windows.Forms { public partial class DataGridView { private class DataGridViewSelectedCellsAccessibleObject : AccessibleObject { DataGridView owner; public DataGridViewSelectedCellsAccessibleObject(DataGridView owner) { this.owner = owner; } public override string Name { get { return SR.GetString(SR.DataGridView_AccSelectedCellsName); } } public override AccessibleObject Parent { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { return this.owner.AccessibilityObject; } } public override AccessibleRole Role { get { return AccessibleRole.Grouping; } } public override AccessibleStates State { get { return AccessibleStates.Selected | AccessibleStates.Selectable; } } public override string Value { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { return this.Name; } } public override AccessibleObject GetChild(int index) { if (index >= 0 && index < this.owner.GetCellCount(DataGridViewElementStates.Selected)) { return this.owner.SelectedCell(index).AccessibilityObject; } else { return null; } } public override int GetChildCount() { return this.owner.GetCellCount(DataGridViewElementStates.Selected); } public override AccessibleObject GetSelected() { return this; } public override AccessibleObject GetFocused() { if (this.owner.CurrentCell != null && this.owner.CurrentCell.Selected) { return this.owner.CurrentCell.AccessibilityObject; } else { return null; } } [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public override AccessibleObject Navigate(AccessibleNavigation navigationDirection) { switch (navigationDirection) { case AccessibleNavigation.FirstChild: if (this.owner.GetCellCount(DataGridViewElementStates.Selected) > 0) { return this.owner.SelectedCell(0).AccessibilityObject; } else { return null; } case AccessibleNavigation.LastChild: if (this.owner.GetCellCount(DataGridViewElementStates.Selected) > 0) { return this.owner.SelectedCell(this.owner.GetCellCount(DataGridViewElementStates.Selected) - 1).AccessibilityObject; } else { return null; } default: { return null; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Security.Permissions; namespace System.Windows.Forms { public partial class DataGridView { private class DataGridViewSelectedCellsAccessibleObject : AccessibleObject { DataGridView owner; public DataGridViewSelectedCellsAccessibleObject(DataGridView owner) { this.owner = owner; } public override string Name { get { return SR.GetString(SR.DataGridView_AccSelectedCellsName); } } public override AccessibleObject Parent { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { return this.owner.AccessibilityObject; } } public override AccessibleRole Role { get { return AccessibleRole.Grouping; } } public override AccessibleStates State { get { return AccessibleStates.Selected | AccessibleStates.Selectable; } } public override string Value { [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] get { return this.Name; } } public override AccessibleObject GetChild(int index) { if (index >= 0 && index < this.owner.GetCellCount(DataGridViewElementStates.Selected)) { return this.owner.SelectedCell(index).AccessibilityObject; } else { return null; } } public override int GetChildCount() { return this.owner.GetCellCount(DataGridViewElementStates.Selected); } public override AccessibleObject GetSelected() { return this; } public override AccessibleObject GetFocused() { if (this.owner.CurrentCell != null && this.owner.CurrentCell.Selected) { return this.owner.CurrentCell.AccessibilityObject; } else { return null; } } [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public override AccessibleObject Navigate(AccessibleNavigation navigationDirection) { switch (navigationDirection) { case AccessibleNavigation.FirstChild: if (this.owner.GetCellCount(DataGridViewElementStates.Selected) > 0) { return this.owner.SelectedCell(0).AccessibilityObject; } else { return null; } case AccessibleNavigation.LastChild: if (this.owner.GetCellCount(DataGridViewElementStates.Selected) > 0) { return this.owner.SelectedCell(this.owner.GetCellCount(DataGridViewElementStates.Selected) - 1).AccessibilityObject; } else { return null; } default: { return null; } } } } } } // 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
- validationstate.cs
- ApplicationHost.cs
- HandlerBase.cs
- DataColumnCollection.cs
- UnauthorizedWebPart.cs
- ReadOnlyHierarchicalDataSource.cs
- ConcurrencyBehavior.cs
- GiveFeedbackEventArgs.cs
- EventsTab.cs
- MessageBox.cs
- PeerNameRecordCollection.cs
- StatusBarItemAutomationPeer.cs
- EntityTypeEmitter.cs
- CollectionViewSource.cs
- SHA1.cs
- SiteIdentityPermission.cs
- ClusterRegistryConfigurationProvider.cs
- FileLogRecordHeader.cs
- ContainerAction.cs
- NonClientArea.cs
- TargetConverter.cs
- ValidationSummary.cs
- ThreadExceptionDialog.cs
- AccessedThroughPropertyAttribute.cs
- BridgeDataRecord.cs
- altserialization.cs
- Membership.cs
- MenuItemStyle.cs
- ChannelSinkStacks.cs
- InsufficientMemoryException.cs
- MultiSelector.cs
- Expr.cs
- TreeNodeSelectionProcessor.cs
- ChannelEndpointElement.cs
- BoundPropertyEntry.cs
- Registration.cs
- HtmlControlAdapter.cs
- SqlFacetAttribute.cs
- CachedFontFamily.cs
- SafeArrayTypeMismatchException.cs
- Subset.cs
- StateMachineTimers.cs
- ToolStripRenderEventArgs.cs
- DisplayInformation.cs
- TextSerializer.cs
- ChangePassword.cs
- OleCmdHelper.cs
- HttpRuntime.cs
- AutomationPropertyInfo.cs
- DataFormat.cs
- AspCompat.cs
- PictureBox.cs
- ExpressionHelper.cs
- TabItem.cs
- SqlDataSourceDesigner.cs
- NavigatorInput.cs
- SqlError.cs
- Vector3DConverter.cs
- CheckBoxFlatAdapter.cs
- processwaithandle.cs
- InfoCardService.cs
- SafeRegistryHandle.cs
- XmlValidatingReaderImpl.cs
- BookmarkCallbackWrapper.cs
- InvokeWebServiceDesigner.cs
- MsmqInputMessagePool.cs
- DocumentReference.cs
- SystemThemeKey.cs
- BooleanExpr.cs
- TranslateTransform3D.cs
- BitmapImage.cs
- SqlConnectionPoolGroupProviderInfo.cs
- IOException.cs
- Margins.cs
- CompilerError.cs
- DataGridState.cs
- PeerTransportElement.cs
- DBNull.cs
- SplitterEvent.cs
- LayoutUtils.cs
- RuleProcessor.cs
- SchemaConstraints.cs
- PersonalizationStateInfo.cs
- sortedlist.cs
- OpCodes.cs
- WindowsImpersonationContext.cs
- SharedPersonalizationStateInfo.cs
- Rules.cs
- DictionarySurrogate.cs
- DesignTimeParseData.cs
- Point.cs
- XmlSchemaRedefine.cs
- MouseEventArgs.cs
- bindurihelper.cs
- WindowsStatusBar.cs
- HttpFileCollection.cs
- Parallel.cs
- DataGridViewLayoutData.cs
- ConstructorNeedsTagAttribute.cs
- SapiAttributeParser.cs