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
- DeferredReference.cs
- Module.cs
- RunInstallerAttribute.cs
- FrameworkElementFactory.cs
- UTF32Encoding.cs
- AbstractDataSvcMapFileLoader.cs
- InternalConfigRoot.cs
- Util.cs
- ClientConfigurationHost.cs
- InvalidChannelBindingException.cs
- ToolTipService.cs
- RubberbandSelector.cs
- StrokeNode.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- UDPClient.cs
- SymbolMethod.cs
- WindowsPen.cs
- SchemaTableOptionalColumn.cs
- WhitespaceRule.cs
- RuleInfoComparer.cs
- KnownIds.cs
- DefaultValueTypeConverter.cs
- BitmapCodecInfoInternal.cs
- PerformanceCounterLib.cs
- EventPropertyMap.cs
- DataGridViewColumnCollection.cs
- SchemaImporterExtensionsSection.cs
- DetailsViewCommandEventArgs.cs
- DictionaryBase.cs
- AffineTransform3D.cs
- RootBuilder.cs
- SubstitutionList.cs
- VBCodeProvider.cs
- ChannelManager.cs
- DocumentViewer.cs
- ReferencedCollectionType.cs
- TcpWorkerProcess.cs
- PropertyGridView.cs
- StringUtil.cs
- OleCmdHelper.cs
- ProtocolsSection.cs
- DesignerView.cs
- EventWaitHandleSecurity.cs
- StoreConnection.cs
- XmlSerializerFactory.cs
- WebPartVerbsEventArgs.cs
- ExpressionPrefixAttribute.cs
- SafeMemoryMappedViewHandle.cs
- ComponentChangingEvent.cs
- KnownColorTable.cs
- EntityCommandDefinition.cs
- Timeline.cs
- DbConnectionFactory.cs
- FormattedText.cs
- JsonStringDataContract.cs
- SafeProcessHandle.cs
- DataViewManagerListItemTypeDescriptor.cs
- ControlDesignerState.cs
- ClientConfigurationHost.cs
- AdCreatedEventArgs.cs
- HtmlTableCellCollection.cs
- IsolatedStorageFilePermission.cs
- TrackingRecordPreFilter.cs
- ISFTagAndGuidCache.cs
- TypeExtensionConverter.cs
- StructuredTypeEmitter.cs
- _CommandStream.cs
- OperatingSystemVersionCheck.cs
- EventListenerClientSide.cs
- XmlDataSource.cs
- TextEffect.cs
- TagMapCollection.cs
- IMembershipProvider.cs
- ErrorStyle.cs
- FontClient.cs
- LiteralControl.cs
- WebPartCloseVerb.cs
- InputEventArgs.cs
- LayoutInformation.cs
- GetCertificateRequest.cs
- SchemaSetCompiler.cs
- Camera.cs
- QueryLifecycle.cs
- PanelDesigner.cs
- XmlDataProvider.cs
- PropertyDescriptorComparer.cs
- MasterPageBuildProvider.cs
- RemoteWebConfigurationHost.cs
- SlipBehavior.cs
- TaskHelper.cs
- UiaCoreTypesApi.cs
- Blend.cs
- ParameterElementCollection.cs
- ConditionalAttribute.cs
- StdRegProviderWrapper.cs
- HTMLTextWriter.cs
- WebPartCollection.cs
- DataGrid.cs
- RuntimeConfig.cs
- COM2ComponentEditor.cs