Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / TableCellAutomationPeer.cs / 1305600 / TableCellAutomationPeer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: TableCellAutomationPeer.cs // // Description: Automation peer for TableCell // //--------------------------------------------------------------------------- using System.Windows.Automation.Provider; // IRawElementProviderSimple using System.Windows.Documents; namespace System.Windows.Automation.Peers { /// public class TableCellAutomationPeer : TextElementAutomationPeer, IGridItemProvider { ////// Constructor. /// /// Owner of the AutomationPeer. public TableCellAutomationPeer(TableCell owner) : base(owner) { } ////// public override object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.GridItem) { return this; } else { return base.GetPattern(patternInterface); } } ////// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Custom; } ////// /// protected override string GetLocalizedControlTypeCore() { return "cell"; } ////// /// protected override string GetClassNameCore() { return "TableCell"; } ////// /// protected override bool IsControlElementCore() { return true; } ////// /// protected override bool IsContentElementCore() { return true; } ////// /// Raises property changed events in response to column span change. /// internal void OnColumnSpanChanged(int oldValue, int newValue) { RaisePropertyChangedEvent(GridItemPatternIdentifiers.ColumnSpanProperty, oldValue, newValue); } ////// Raises property changed events in response to row span change. /// internal void OnRowSpanChanged(int oldValue, int newValue) { RaisePropertyChangedEvent(GridItemPatternIdentifiers.RowSpanProperty, oldValue, newValue); } //------------------------------------------------------------------- // // IGridProvider Members // //------------------------------------------------------------------- #region IGridItemProvider Members ////// Returns the current row that the item is located at. /// int IGridItemProvider.Row { get { return ((TableCell)Owner).RowIndex; } } ////// Returns the current column that the item is located at. /// int IGridItemProvider.Column { get { return ((TableCell)Owner).ColumnIndex; } } ////// Return the current number of rows that the item spans. /// int IGridItemProvider.RowSpan { get { return ((TableCell)Owner).RowSpan; } } ////// Return the current number of columns that the item spans. /// int IGridItemProvider.ColumnSpan { get { return ((TableCell)Owner).ColumnSpan; } } ////// Returns the container that maintains the grid layout for the item. /// IRawElementProviderSimple IGridItemProvider.ContainingGrid { get { if ((TableCell)Owner != null) { return ProviderFromPeer(CreatePeerForElement(((TableCell)Owner).Table)); } else { return null; } } } #endregion IGridItemProvider Members } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: TableCellAutomationPeer.cs // // Description: Automation peer for TableCell // //--------------------------------------------------------------------------- using System.Windows.Automation.Provider; // IRawElementProviderSimple using System.Windows.Documents; namespace System.Windows.Automation.Peers { /// public class TableCellAutomationPeer : TextElementAutomationPeer, IGridItemProvider { ////// Constructor. /// /// Owner of the AutomationPeer. public TableCellAutomationPeer(TableCell owner) : base(owner) { } ////// public override object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.GridItem) { return this; } else { return base.GetPattern(patternInterface); } } ////// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Custom; } ////// /// protected override string GetLocalizedControlTypeCore() { return "cell"; } ////// /// protected override string GetClassNameCore() { return "TableCell"; } ////// /// protected override bool IsControlElementCore() { return true; } ////// /// protected override bool IsContentElementCore() { return true; } ////// /// Raises property changed events in response to column span change. /// internal void OnColumnSpanChanged(int oldValue, int newValue) { RaisePropertyChangedEvent(GridItemPatternIdentifiers.ColumnSpanProperty, oldValue, newValue); } ////// Raises property changed events in response to row span change. /// internal void OnRowSpanChanged(int oldValue, int newValue) { RaisePropertyChangedEvent(GridItemPatternIdentifiers.RowSpanProperty, oldValue, newValue); } //------------------------------------------------------------------- // // IGridProvider Members // //------------------------------------------------------------------- #region IGridItemProvider Members ////// Returns the current row that the item is located at. /// int IGridItemProvider.Row { get { return ((TableCell)Owner).RowIndex; } } ////// Returns the current column that the item is located at. /// int IGridItemProvider.Column { get { return ((TableCell)Owner).ColumnIndex; } } ////// Return the current number of rows that the item spans. /// int IGridItemProvider.RowSpan { get { return ((TableCell)Owner).RowSpan; } } ////// Return the current number of columns that the item spans. /// int IGridItemProvider.ColumnSpan { get { return ((TableCell)Owner).ColumnSpan; } } ////// Returns the container that maintains the grid layout for the item. /// IRawElementProviderSimple IGridItemProvider.ContainingGrid { get { if ((TableCell)Owner != null) { return ProviderFromPeer(CreatePeerForElement(((TableCell)Owner).Table)); } else { return null; } } } #endregion IGridItemProvider Members } } // 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
- ChunkedMemoryStream.cs
- CompilerResults.cs
- WebPartCancelEventArgs.cs
- CompoundFileDeflateTransform.cs
- CommonRemoteMemoryBlock.cs
- CommandArguments.cs
- LinkArea.cs
- PlainXmlDeserializer.cs
- DBDataPermission.cs
- TdsParserSessionPool.cs
- CqlLexerHelpers.cs
- PartEditor.cs
- Perspective.cs
- DetailsViewUpdateEventArgs.cs
- EmbossBitmapEffect.cs
- BaseDataList.cs
- DataServicePagingProviderWrapper.cs
- GenericUI.cs
- OracleRowUpdatedEventArgs.cs
- IncrementalCompileAnalyzer.cs
- BehaviorDragDropEventArgs.cs
- DataTransferEventArgs.cs
- CommandHelper.cs
- ServerValidateEventArgs.cs
- SparseMemoryStream.cs
- NativeActivity.cs
- StorageComplexTypeMapping.cs
- QueuePathDialog.cs
- AuthenticodeSignatureInformation.cs
- KerberosTicketHashIdentifierClause.cs
- Propagator.cs
- PieceNameHelper.cs
- PropertyConverter.cs
- LambdaCompiler.Lambda.cs
- SubpageParaClient.cs
- UnsafeNativeMethods.cs
- StylusOverProperty.cs
- JsonFaultDetail.cs
- TypeConverterHelper.cs
- WorkflowRuntimeElement.cs
- SessionStateUtil.cs
- DrawingServices.cs
- EntityDataSourceSelectedEventArgs.cs
- MULTI_QI.cs
- DummyDataSource.cs
- SqlFactory.cs
- SchemaImporterExtensionElementCollection.cs
- SqlMultiplexer.cs
- GenerateHelper.cs
- RegexStringValidator.cs
- AssociationProvider.cs
- IgnorePropertiesAttribute.cs
- ServiceRoute.cs
- DocumentDesigner.cs
- AccessDataSourceDesigner.cs
- NativeCppClassAttribute.cs
- ControllableStoryboardAction.cs
- RoutedCommand.cs
- XsdDuration.cs
- TransformedBitmap.cs
- ImageInfo.cs
- PeerCollaborationPermission.cs
- ComponentEditorPage.cs
- DefaultMergeHelper.cs
- ExtensionSimplifierMarkupObject.cs
- MimeTypeMapper.cs
- Conditional.cs
- DataControlFieldHeaderCell.cs
- RoleGroupCollection.cs
- Compiler.cs
- ErrorFormatterPage.cs
- ContentOperations.cs
- SqlConnectionPoolProviderInfo.cs
- ProfileService.cs
- BindingGroup.cs
- SoapObjectWriter.cs
- HttpEncoder.cs
- DynamicValidatorEventArgs.cs
- WebScriptServiceHost.cs
- BooleanProjectedSlot.cs
- ProvidePropertyAttribute.cs
- ServiceDescriptionImporter.cs
- DynamicILGenerator.cs
- VisualStyleRenderer.cs
- ProfileManager.cs
- HyperLinkField.cs
- ThaiBuddhistCalendar.cs
- PolyBezierSegment.cs
- StringReader.cs
- ToolStripItemImageRenderEventArgs.cs
- WebHttpSecurity.cs
- BrowserCapabilitiesCodeGenerator.cs
- Int16Animation.cs
- TaskDesigner.cs
- UpDownEvent.cs
- Mappings.cs
- TailPinnedEventArgs.cs
- CompilerResults.cs
- ExpanderAutomationPeer.cs
- PasswordDeriveBytes.cs