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
- TransformPatternIdentifiers.cs
- TableLayoutRowStyleCollection.cs
- PageTextBox.cs
- DataGridPagingPage.cs
- TrackingStringDictionary.cs
- CookieParameter.cs
- ToolStripSeparatorRenderEventArgs.cs
- AuthorizationPolicyTypeElementCollection.cs
- TextTreeUndoUnit.cs
- Dictionary.cs
- FlowPosition.cs
- GreaterThan.cs
- State.cs
- EntityAdapter.cs
- PointCollectionValueSerializer.cs
- DataMemberConverter.cs
- CustomExpressionEventArgs.cs
- Utils.cs
- RSACryptoServiceProvider.cs
- NotifyCollectionChangedEventArgs.cs
- FormatConvertedBitmap.cs
- CurrentChangingEventArgs.cs
- InternalConfigRoot.cs
- FontFaceLayoutInfo.cs
- WebRequestModulesSection.cs
- ConfigurationStrings.cs
- ItemsControlAutomationPeer.cs
- LinkLabel.cs
- SystemIPGlobalStatistics.cs
- VectorConverter.cs
- CrossSiteScriptingValidation.cs
- Vector3DAnimation.cs
- GenericArgumentsUpdater.cs
- DataMemberAttribute.cs
- XamlRtfConverter.cs
- AnonymousIdentificationSection.cs
- Utils.cs
- WasEndpointConfigContainer.cs
- ManagementObjectSearcher.cs
- ItemsPresenter.cs
- wmiprovider.cs
- RectAnimationUsingKeyFrames.cs
- SuppressIldasmAttribute.cs
- RotateTransform.cs
- AssociationSet.cs
- PointConverter.cs
- ASCIIEncoding.cs
- StorageFunctionMapping.cs
- RegexTree.cs
- CTreeGenerator.cs
- Activator.cs
- VirtualPathProvider.cs
- CapabilitiesState.cs
- KnownColorTable.cs
- BrowserDefinition.cs
- TracedNativeMethods.cs
- GlyphRunDrawing.cs
- XmlWhitespace.cs
- NativeMethods.cs
- Timeline.cs
- LayoutExceptionEventArgs.cs
- OleDragDropHandler.cs
- SchemaImporter.cs
- Int16Animation.cs
- ExtensionDataReader.cs
- AppDomain.cs
- ProfileProvider.cs
- PropertyGridEditorPart.cs
- ConfigurationElement.cs
- SvcFileManager.cs
- ScriptingAuthenticationServiceSection.cs
- ObjectStateManager.cs
- UnsafeNativeMethods.cs
- DbConnectionPoolIdentity.cs
- AutomationAttributeInfo.cs
- IntSecurity.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- BehaviorService.cs
- ListViewItem.cs
- TypeConverterHelper.cs
- IsolatedStorageFile.cs
- ListControl.cs
- AvTraceDetails.cs
- GetReadStreamResult.cs
- SafeFileHandle.cs
- DefaultExpressionVisitor.cs
- AccessText.cs
- WebPartsSection.cs
- OleAutBinder.cs
- MenuItemBindingCollection.cs
- WindowsMenu.cs
- ExtendedProtectionPolicyElement.cs
- TrustManagerMoreInformation.cs
- TheQuery.cs
- WebExceptionStatus.cs
- KeyNameIdentifierClause.cs
- XamlInt32CollectionSerializer.cs
- OleDbConnectionInternal.cs
- TreeViewCancelEvent.cs
- PartialClassGenerationTaskInternal.cs