Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- TraceFilter.cs
- Visitors.cs
- RedirectionProxy.cs
- CodeVariableDeclarationStatement.cs
- SyntaxCheck.cs
- Transform3DGroup.cs
- CompiledIdentityConstraint.cs
- ByteStreamGeometryContext.cs
- SchemaMerger.cs
- TypeSystem.cs
- PerformanceCounterCategory.cs
- ApplicationBuildProvider.cs
- ThemeDictionaryExtension.cs
- LiteralDesigner.cs
- DataTableReader.cs
- FormsAuthenticationEventArgs.cs
- XomlCompilerResults.cs
- UpdateTracker.cs
- SystemPens.cs
- DataGridPagingPage.cs
- DataSourceBooleanViewSchemaConverter.cs
- CodeEntryPointMethod.cs
- CodeAttributeArgumentCollection.cs
- HelloOperation11AsyncResult.cs
- ManipulationStartingEventArgs.cs
- Interlocked.cs
- listitem.cs
- Light.cs
- SamlAuthenticationClaimResource.cs
- FileIOPermission.cs
- EdmComplexTypeAttribute.cs
- DefaultTraceListener.cs
- HandledEventArgs.cs
- HttpCachePolicy.cs
- StructuredTypeEmitter.cs
- ColumnMapTranslator.cs
- UIElement.cs
- PlatformCulture.cs
- StorageTypeMapping.cs
- HtmlInputSubmit.cs
- UseLicense.cs
- Region.cs
- TaskForm.cs
- AsyncInvokeOperation.cs
- UnsafeMethods.cs
- MouseWheelEventArgs.cs
- PropertyPathWorker.cs
- SqlMetaData.cs
- RuleInfoComparer.cs
- Messages.cs
- RSAProtectedConfigurationProvider.cs
- DocumentEventArgs.cs
- WorkflowRuntime.cs
- FileDialogCustomPlace.cs
- COM2PropertyDescriptor.cs
- Image.cs
- DynamicObjectAccessor.cs
- TypeToken.cs
- RectAnimation.cs
- Rect3D.cs
- HttpBrowserCapabilitiesWrapper.cs
- ProcessThread.cs
- TextPointerBase.cs
- SystemUnicastIPAddressInformation.cs
- PropertyChangingEventArgs.cs
- EntryPointNotFoundException.cs
- ListCollectionView.cs
- ModuleBuilder.cs
- XPathNavigator.cs
- BindingList.cs
- FacetValues.cs
- WebBrowser.cs
- DynamicILGenerator.cs
- PostBackTrigger.cs
- MailDefinition.cs
- UIElement3DAutomationPeer.cs
- AuthenticationConfig.cs
- TypeExtension.cs
- CacheDependency.cs
- UIHelper.cs
- MultiPageTextView.cs
- OutputCacheSettingsSection.cs
- DataGridViewRowConverter.cs
- RoamingStoreFile.cs
- FontCacheLogic.cs
- Triangle.cs
- Span.cs
- TransformerTypeCollection.cs
- UnrecognizedPolicyAssertionElement.cs
- CapabilitiesRule.cs
- NamespaceInfo.cs
- TripleDES.cs
- CssStyleCollection.cs
- ReferentialConstraint.cs
- CLRBindingWorker.cs
- UTF7Encoding.cs
- SiteMapNodeItem.cs
- CollectionBuilder.cs
- PictureBox.cs
- SpeechSeg.cs