Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / TextBlockAutomationPeer.cs / 1 / TextBlockAutomationPeer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: TextBlockAutomationPeer.cs // // Description: AutomationPeer associated with TextBlock. // //--------------------------------------------------------------------------- using System.Collections.Generic; // Listusing System.Windows.Controls; // TextBlock using System.Windows.Documents; // ITextContainer using MS.Internal.Documents; // TextContainerHelper namespace System.Windows.Automation.Peers { /// /// AutomationPeer associated with TextBlock. /// public class TextBlockAutomationPeer : FrameworkElementAutomationPeer { ////// Constructor. /// /// Owner of the AutomationPeer. public TextBlockAutomationPeer(TextBlock owner) : base(owner) { } ////// protected override List/// GetChildrenCore() { List peers = null; TextBlock owner = (TextBlock)Owner; // TextBlock has children only if it has complex content. if (owner.HasComplexContent) { peers = TextContainerHelper.GetAutomationPeersFromRange(owner.TextContainer.Start, owner.TextContainer.End, null); } return peers; } /// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Text; } ////// /// ////// protected override string GetClassNameCore() { return "TextBlock"; } /// /// override protected bool IsControlElementCore() { // Return true if TextBlock is not part of the style return ((TextBlock)Owner).TemplatedParent == null; } } } // 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: TextBlockAutomationPeer.cs // // Description: AutomationPeer associated with TextBlock. // //--------------------------------------------------------------------------- using System.Collections.Generic; // List/// using System.Windows.Controls; // TextBlock using System.Windows.Documents; // ITextContainer using MS.Internal.Documents; // TextContainerHelper namespace System.Windows.Automation.Peers { /// /// AutomationPeer associated with TextBlock. /// public class TextBlockAutomationPeer : FrameworkElementAutomationPeer { ////// Constructor. /// /// Owner of the AutomationPeer. public TextBlockAutomationPeer(TextBlock owner) : base(owner) { } ////// protected override List/// GetChildrenCore() { List peers = null; TextBlock owner = (TextBlock)Owner; // TextBlock has children only if it has complex content. if (owner.HasComplexContent) { peers = TextContainerHelper.GetAutomationPeersFromRange(owner.TextContainer.Start, owner.TextContainer.End, null); } return peers; } /// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Text; } ////// /// ////// protected override string GetClassNameCore() { return "TextBlock"; } /// /// override protected bool IsControlElementCore() { // Return true if TextBlock is not part of the style return ((TextBlock)Owner).TemplatedParent == null; } } } // 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
- SingleConverter.cs
- TreeNodeBindingCollection.cs
- Ray3DHitTestResult.cs
- DataGridViewTopLeftHeaderCell.cs
- StatusBarItemAutomationPeer.cs
- ObjectMemberMapping.cs
- ItemChangedEventArgs.cs
- NonSerializedAttribute.cs
- IODescriptionAttribute.cs
- EntityDataSourceContainerNameConverter.cs
- UInt16Converter.cs
- ComponentResourceManager.cs
- SoapReflectionImporter.cs
- XmlDocumentSurrogate.cs
- RowUpdatingEventArgs.cs
- BinaryEditor.cs
- ConfigXmlText.cs
- TargetControlTypeCache.cs
- ResourceContainer.cs
- httpstaticobjectscollection.cs
- KeyFrames.cs
- SafeRightsManagementSessionHandle.cs
- EnvelopedSignatureTransform.cs
- RegexMatch.cs
- FormsIdentity.cs
- ProcessProtocolHandler.cs
- EntitySqlQueryBuilder.cs
- WindowsAuthenticationModule.cs
- ResourceReferenceExpression.cs
- FamilyCollection.cs
- AttributedMetaModel.cs
- ConvertEvent.cs
- Rotation3DAnimation.cs
- StreamReader.cs
- XmlMemberMapping.cs
- PropertyTabAttribute.cs
- TogglePatternIdentifiers.cs
- _HelperAsyncResults.cs
- FastEncoderWindow.cs
- SoapObjectInfo.cs
- ClassHandlersStore.cs
- DoWorkEventArgs.cs
- HttpRuntime.cs
- IUnknownConstantAttribute.cs
- ExtensionWindowResizeGrip.cs
- KeyboardDevice.cs
- regiisutil.cs
- FrameDimension.cs
- Property.cs
- AccessDataSource.cs
- PolicyManager.cs
- MissingFieldException.cs
- ColorConvertedBitmap.cs
- TextPointer.cs
- RowUpdatedEventArgs.cs
- AutomationElementIdentifiers.cs
- CompositeControlDesigner.cs
- GridViewUpdateEventArgs.cs
- IndexerNameAttribute.cs
- AutomationIdentifierGuids.cs
- ZoneButton.cs
- MobileUserControlDesigner.cs
- TextEditorTyping.cs
- ExpressionPrefixAttribute.cs
- HtmlFormWrapper.cs
- ClientConvert.cs
- StateMachineWorkflowInstance.cs
- httpserverutility.cs
- DocumentScope.cs
- ArrayExtension.cs
- safelink.cs
- altserialization.cs
- EditorResources.cs
- XmlDataLoader.cs
- PseudoWebRequest.cs
- _FtpControlStream.cs
- ColorTransformHelper.cs
- DataGridViewLayoutData.cs
- MimeTypeMapper.cs
- DataGridViewAdvancedBorderStyle.cs
- ParserHooks.cs
- TypeToken.cs
- TextProviderWrapper.cs
- MoveSizeWinEventHandler.cs
- SelectManyQueryOperator.cs
- PerformanceCounterPermissionEntryCollection.cs
- PreviewPageInfo.cs
- BindingListCollectionView.cs
- EpmContentDeSerializer.cs
- ListViewInsertionMark.cs
- RoleManagerSection.cs
- IIS7UserPrincipal.cs
- CodeTypeReference.cs
- MediaElement.cs
- DataControlFieldHeaderCell.cs
- ExtensibleClassFactory.cs
- TrackingRecordPreFilter.cs
- Int32.cs
- DataGridViewColumnEventArgs.cs
- ArgumentException.cs