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 / 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
- WindowsTitleBar.cs
- ReadingWritingEntityEventArgs.cs
- PnrpPermission.cs
- FileSystemEventArgs.cs
- Control.cs
- DbModificationClause.cs
- DocumentPageHost.cs
- XPSSignatureDefinition.cs
- AutomationPropertyInfo.cs
- HtmlGenericControl.cs
- SharedConnectionInfo.cs
- DataColumn.cs
- LOSFormatter.cs
- KeyEventArgs.cs
- StringInfo.cs
- ArgumentException.cs
- ThreadInterruptedException.cs
- SqlTrackingQuery.cs
- MultipartContentParser.cs
- TextEditorCharacters.cs
- PartialArray.cs
- CmsUtils.cs
- ExeConfigurationFileMap.cs
- XpsFilter.cs
- Exceptions.cs
- Type.cs
- DeploymentSection.cs
- SHA1.cs
- X509CertificateTrustedIssuerElementCollection.cs
- KeyTimeConverter.cs
- XmlSchemaComplexContentRestriction.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- InkCanvas.cs
- ListDesigner.cs
- WebUtil.cs
- CannotUnloadAppDomainException.cs
- DataContractSet.cs
- Point3DKeyFrameCollection.cs
- NTAccount.cs
- LostFocusEventManager.cs
- TableAutomationPeer.cs
- RawStylusInputCustomData.cs
- GcHandle.cs
- GenericEnumConverter.cs
- ByteConverter.cs
- sitestring.cs
- ClientConfigurationHost.cs
- NumericPagerField.cs
- Rotation3DAnimation.cs
- MultilineStringConverter.cs
- AutomationIdentifier.cs
- WsdlEndpointConversionContext.cs
- AdPostCacheSubstitution.cs
- WaveHeader.cs
- FixedSOMImage.cs
- SqlCacheDependencyDatabase.cs
- DictionaryEntry.cs
- AssemblyBuilder.cs
- BindingRestrictions.cs
- WebPartVerbCollection.cs
- CacheHelper.cs
- TextBoxBaseDesigner.cs
- BitmapImage.cs
- DataControlImageButton.cs
- precedingquery.cs
- BaseParaClient.cs
- SqlDataAdapter.cs
- APCustomTypeDescriptor.cs
- FastEncoder.cs
- WebMessageBodyStyleHelper.cs
- RightsManagementInformation.cs
- SelectionProviderWrapper.cs
- Vector3DCollection.cs
- StringResourceManager.cs
- ListDependantCardsRequest.cs
- FormattedText.cs
- Literal.cs
- WorkerRequest.cs
- CoreSwitches.cs
- Visual.cs
- ClipboardProcessor.cs
- ScrollViewer.cs
- SspiSafeHandles.cs
- Latin1Encoding.cs
- PreDigestedSignedInfo.cs
- GlobalProxySelection.cs
- ScriptModule.cs
- HorizontalAlignConverter.cs
- DataGridViewCellValueEventArgs.cs
- SByteConverter.cs
- VirtualPath.cs
- WmlLinkAdapter.cs
- PasswordRecovery.cs
- ListControl.cs
- ShapeTypeface.cs
- DeclarationUpdate.cs
- SHA512.cs
- XsdDuration.cs
- InstanceHandle.cs
- QueryServiceConfigHandle.cs