Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Automation / Peers / TableCellAutomationPeer.cs / 1 / 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; } return null; } ////// /// 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; } return null; } ////// /// 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
- DataMemberFieldEditor.cs
- Journal.cs
- DBCommand.cs
- Oid.cs
- TextParagraphProperties.cs
- EndpointReference.cs
- AppModelKnownContentFactory.cs
- TableCellCollection.cs
- ContentType.cs
- RetrieveVirtualItemEventArgs.cs
- BrowserCapabilitiesFactoryBase.cs
- SoapMessage.cs
- MobileListItem.cs
- PtsHelper.cs
- OleDbError.cs
- CodeTryCatchFinallyStatement.cs
- MemberAccessException.cs
- TraceSection.cs
- SessionIDManager.cs
- IteratorFilter.cs
- Completion.cs
- XmlSchemaAttribute.cs
- FilterQuery.cs
- DataBoundLiteralControl.cs
- AttributeQuery.cs
- ZoneLinkButton.cs
- DataConnectionHelper.cs
- Line.cs
- WebReferenceCollection.cs
- ContainerSelectorBehavior.cs
- ValidationPropertyAttribute.cs
- EdmToObjectNamespaceMap.cs
- LiteralTextParser.cs
- HMAC.cs
- Condition.cs
- ECDsaCng.cs
- WebServiceReceiveDesigner.cs
- Zone.cs
- EdmType.cs
- CellParaClient.cs
- SimpleRecyclingCache.cs
- ModuleConfigurationInfo.cs
- EnumType.cs
- TaskSchedulerException.cs
- ByteConverter.cs
- ColorAnimationBase.cs
- RelativeSource.cs
- _OverlappedAsyncResult.cs
- safePerfProviderHandle.cs
- MessageSecurityOverTcpElement.cs
- HashAlgorithm.cs
- HttpDebugHandler.cs
- Pool.cs
- Inflater.cs
- WebPartChrome.cs
- UnsafeNativeMethods.cs
- DocumentViewerAutomationPeer.cs
- GeneralTransform2DTo3DTo2D.cs
- SymbolEqualComparer.cs
- FixUp.cs
- WebFaultException.cs
- PathGeometry.cs
- ConfigXmlWhitespace.cs
- TypeElementCollection.cs
- DesignerCalendarAdapter.cs
- AssociativeAggregationOperator.cs
- XmlObjectSerializerReadContextComplex.cs
- FontSourceCollection.cs
- TabControlCancelEvent.cs
- SamlConditions.cs
- FontCacheUtil.cs
- CheckBoxList.cs
- PopOutPanel.cs
- XmlHelper.cs
- GlyphRunDrawing.cs
- TdsEnums.cs
- StrokeSerializer.cs
- SystemBrushes.cs
- ClipboardData.cs
- ClientScriptItemCollection.cs
- HybridWebProxyFinder.cs
- BmpBitmapDecoder.cs
- AuthenticatedStream.cs
- NamespaceEmitter.cs
- ThreadBehavior.cs
- PointKeyFrameCollection.cs
- EncodingDataItem.cs
- IProvider.cs
- ChannelAcceptor.cs
- Script.cs
- InstanceDataCollection.cs
- BinaryObjectReader.cs
- XmlTextAttribute.cs
- ServerValidateEventArgs.cs
- WeakReadOnlyCollection.cs
- DocumentGrid.cs
- PrintDialog.cs
- FontResourceCache.cs
- SqlGenericUtil.cs
- Stackframe.cs