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
- XmlHelper.cs
- Matrix.cs
- WorkflowServiceAttributesTypeConverter.cs
- SecurityChannelListener.cs
- ArgIterator.cs
- CodeTypeMemberCollection.cs
- TextProperties.cs
- HelpKeywordAttribute.cs
- JsonDeserializer.cs
- GroupStyle.cs
- CustomTypeDescriptor.cs
- safemediahandle.cs
- SQLGuid.cs
- OdbcConnectionHandle.cs
- __TransparentProxy.cs
- TypeConverters.cs
- Geometry3D.cs
- DbConnectionInternal.cs
- OdbcConnectionStringbuilder.cs
- ProviderSettingsCollection.cs
- BookmarkScopeManager.cs
- ControlFilterExpression.cs
- OdbcHandle.cs
- GeneratedContractType.cs
- Queue.cs
- XamlStackWriter.cs
- SingleAnimation.cs
- RuntimeConfigurationRecord.cs
- COM2ExtendedUITypeEditor.cs
- AdapterUtil.cs
- Typeface.cs
- ProcessHost.cs
- CompilerGlobalScopeAttribute.cs
- VerbConverter.cs
- TheQuery.cs
- GroupQuery.cs
- TitleStyle.cs
- TimeZone.cs
- Size.cs
- OutputCacheSettings.cs
- HttpCookieCollection.cs
- RemotingConfigParser.cs
- IPipelineRuntime.cs
- MarkupCompilePass1.cs
- AuthorizationRule.cs
- SQLChars.cs
- MarkerProperties.cs
- TextModifier.cs
- CallbackValidatorAttribute.cs
- EraserBehavior.cs
- SearchForVirtualItemEventArgs.cs
- TextElement.cs
- SecurityPermission.cs
- CheckBoxField.cs
- SmiConnection.cs
- TreeNodeCollectionEditorDialog.cs
- Stacktrace.cs
- Int16.cs
- URLString.cs
- KeyInterop.cs
- SemaphoreFullException.cs
- BinaryMethodMessage.cs
- SingleConverter.cs
- Blend.cs
- PropertyMap.cs
- XmlSerializerAssemblyAttribute.cs
- ColorAnimation.cs
- BuilderInfo.cs
- SelectionProviderWrapper.cs
- ContainerSelectorBehavior.cs
- SoapRpcServiceAttribute.cs
- FlowDecisionLabelFeature.cs
- WindowCollection.cs
- SafeProcessHandle.cs
- UpdatePanelTriggerCollection.cs
- TextFormatter.cs
- BindableTemplateBuilder.cs
- documentation.cs
- DesignerActionList.cs
- HierarchicalDataSourceControl.cs
- BamlLocalizationDictionary.cs
- EventItfInfo.cs
- FilePrompt.cs
- InvalidDataException.cs
- ToolStripDesignerAvailabilityAttribute.cs
- GridPattern.cs
- WebResponse.cs
- MultiSelectRootGridEntry.cs
- PackagePartCollection.cs
- Paragraph.cs
- WorkflowElementDialog.cs
- NamedPermissionSet.cs
- ButtonColumn.cs
- FactoryMaker.cs
- BlurEffect.cs
- ArraySegment.cs
- ErasingStroke.cs
- ViewStateException.cs
- LayoutTable.cs
- DatatypeImplementation.cs