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
- XamlSerializerUtil.cs
- NameTable.cs
- SqlEnums.cs
- DragAssistanceManager.cs
- ChtmlSelectionListAdapter.cs
- GeometryGroup.cs
- TimersDescriptionAttribute.cs
- XPathNavigator.cs
- StylusLogic.cs
- XPathItem.cs
- ContentControl.cs
- safemediahandle.cs
- XmlBindingWorker.cs
- EventProviderBase.cs
- EnterpriseServicesHelper.cs
- WebPartCancelEventArgs.cs
- TdsValueSetter.cs
- TypeHelpers.cs
- ICollection.cs
- DependencyPropertyChangedEventArgs.cs
- ColorConvertedBitmapExtension.cs
- BreakRecordTable.cs
- OdbcEnvironment.cs
- StrokeCollectionConverter.cs
- Quad.cs
- ScrollableControl.cs
- MultilineStringConverter.cs
- DesignOnlyAttribute.cs
- PolicyManager.cs
- ByteAnimationBase.cs
- FontNameEditor.cs
- IndexOutOfRangeException.cs
- X500Name.cs
- FaultContractInfo.cs
- SyndicationSerializer.cs
- WindowsGraphics.cs
- ButtonField.cs
- EdmType.cs
- XamlPathDataSerializer.cs
- WindowsButton.cs
- iisPickupDirectory.cs
- SizeAnimation.cs
- SQLDateTimeStorage.cs
- WindowsIdentity.cs
- ConnectivityStatus.cs
- AnimationTimeline.cs
- XmlBufferReader.cs
- WebBrowserUriTypeConverter.cs
- ContextMenuStripGroupCollection.cs
- FrameworkElementAutomationPeer.cs
- MessageSecurityProtocol.cs
- ExtendedPropertyCollection.cs
- OracleConnectionFactory.cs
- StrongTypingException.cs
- RangeEnumerable.cs
- EventManager.cs
- DbMetaDataColumnNames.cs
- ToolTipAutomationPeer.cs
- PartBasedPackageProperties.cs
- SchemaCollectionPreprocessor.cs
- WebHttpSecurity.cs
- DesignerSerializationOptionsAttribute.cs
- TdsValueSetter.cs
- Vector3DConverter.cs
- UnknownMessageReceivedEventArgs.cs
- GeometryCombineModeValidation.cs
- counter.cs
- Misc.cs
- DataGridView.cs
- WindowsAuthenticationModule.cs
- Win32SafeHandles.cs
- Item.cs
- DataFormat.cs
- TabControlAutomationPeer.cs
- ScrollPattern.cs
- PipeException.cs
- WinInetCache.cs
- CFStream.cs
- ApplicationServiceHelper.cs
- ToolBar.cs
- FocusTracker.cs
- DataServiceHost.cs
- TextAction.cs
- StylusEditingBehavior.cs
- CompilerTypeWithParams.cs
- WebControlParameterProxy.cs
- TreeViewImageKeyConverter.cs
- RectKeyFrameCollection.cs
- BinaryMethodMessage.cs
- HttpModulesSection.cs
- MenuEventArgs.cs
- ExtentJoinTreeNode.cs
- SolidColorBrush.cs
- VarInfo.cs
- DirectionalLight.cs
- AddIn.cs
- RectangleF.cs
- CategoryAttribute.cs
- Listener.cs
- DataControlFieldHeaderCell.cs