Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- selecteditemcollection.cs
- NullableConverter.cs
- InheritanceRules.cs
- EntityDesignerDataSourceView.cs
- BindingOperations.cs
- ServiceManager.cs
- DefaultTextStoreTextComposition.cs
- InstanceKeyView.cs
- HttpCacheVary.cs
- InsufficientMemoryException.cs
- TitleStyle.cs
- RequestCache.cs
- UnsafeNativeMethods.cs
- UiaCoreProviderApi.cs
- CngAlgorithm.cs
- BufferAllocator.cs
- VisualTarget.cs
- InvalidateEvent.cs
- BaseParaClient.cs
- NameTable.cs
- TargetInvocationException.cs
- NumberEdit.cs
- PhysicalAddress.cs
- WeakHashtable.cs
- MatrixTransform.cs
- ControlHelper.cs
- SoapFault.cs
- PrimaryKeyTypeConverter.cs
- MissingMemberException.cs
- SafePEFileHandle.cs
- PrintEvent.cs
- ILGenerator.cs
- WindowsTooltip.cs
- XhtmlBasicPhoneCallAdapter.cs
- RoleManagerSection.cs
- FileDialogPermission.cs
- HeaderCollection.cs
- OpCodes.cs
- LogSwitch.cs
- SafeProcessHandle.cs
- BoundPropertyEntry.cs
- MetadataCollection.cs
- ConsoleKeyInfo.cs
- XamlFilter.cs
- XmlSchemaExternal.cs
- DataGridViewComboBoxEditingControl.cs
- TrustSection.cs
- AttachedPropertyBrowsableAttribute.cs
- ImportCatalogPart.cs
- RepeaterItem.cs
- ConnectionProviderAttribute.cs
- PrintEvent.cs
- SessionEndedEventArgs.cs
- SqlDependencyListener.cs
- ValueChangedEventManager.cs
- OdbcError.cs
- PresentationSource.cs
- WebPartDisplayModeEventArgs.cs
- RenderingBiasValidation.cs
- SimpleType.cs
- ServicePoint.cs
- CngAlgorithmGroup.cs
- ProgressiveCrcCalculatingStream.cs
- ConfigurationValidatorBase.cs
- XPathDocumentIterator.cs
- HtmlMeta.cs
- DocumentReferenceCollection.cs
- ViewgenGatekeeper.cs
- Bits.cs
- PropertyMetadata.cs
- StyleHelper.cs
- ModelFunctionTypeElement.cs
- WorkflowApplicationCompletedEventArgs.cs
- TextDecorationLocationValidation.cs
- FullTextLine.cs
- X509Utils.cs
- AxisAngleRotation3D.cs
- CollectionContainer.cs
- ManagedWndProcTracker.cs
- TCEAdapterGenerator.cs
- LogReservationCollection.cs
- ClientSettingsSection.cs
- PageClientProxyGenerator.cs
- UpDownBase.cs
- DropTarget.cs
- FrameworkContentElement.cs
- ConfigsHelper.cs
- Internal.cs
- Highlights.cs
- TextRangeAdaptor.cs
- Pts.cs
- _OverlappedAsyncResult.cs
- PropertyChangedEventManager.cs
- Models.cs
- LinqDataSourceStatusEventArgs.cs
- PersonalizationEntry.cs
- MappingException.cs
- xsdvalidator.cs
- UriSection.cs
- IdentitySection.cs