Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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; // 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
- Brushes.cs
- ScriptControlManager.cs
- UpnEndpointIdentity.cs
- mediaclock.cs
- MessageRpc.cs
- TransformGroup.cs
- BamlResourceSerializer.cs
- SelectionUIHandler.cs
- ColorBuilder.cs
- DataSourceSelectArguments.cs
- AuthorizationSection.cs
- DataContractSerializerOperationFormatter.cs
- precedingsibling.cs
- XPathDocument.cs
- sitestring.cs
- ThreadStartException.cs
- ExpressionHelper.cs
- ClientSponsor.cs
- NeutralResourcesLanguageAttribute.cs
- XmlTextReaderImplHelpers.cs
- TransformPattern.cs
- SizeAnimationUsingKeyFrames.cs
- AQNBuilder.cs
- ManualResetEventSlim.cs
- UniqueID.cs
- SystemParameters.cs
- RangeBase.cs
- VectorAnimationUsingKeyFrames.cs
- SymmetricAlgorithm.cs
- SchemaImporterExtensionElementCollection.cs
- Assert.cs
- SizeValueSerializer.cs
- DateTimeSerializationSection.cs
- DaylightTime.cs
- TextRenderingModeValidation.cs
- StructuralCache.cs
- UshortList2.cs
- MultiSelectRootGridEntry.cs
- EventLogPermissionEntry.cs
- XmlUnspecifiedAttribute.cs
- PropertyFilter.cs
- XmlSchemaAttributeGroupRef.cs
- ExpandCollapseIsCheckedConverter.cs
- FillBehavior.cs
- Help.cs
- DynamicUpdateCommand.cs
- XsltArgumentList.cs
- WmlTextViewAdapter.cs
- DataTableClearEvent.cs
- MsmqIntegrationElement.cs
- EditableLabelControl.cs
- ServiceParser.cs
- LabelAutomationPeer.cs
- KoreanLunisolarCalendar.cs
- NotifyInputEventArgs.cs
- UpdateManifestForBrowserApplication.cs
- IItemContainerGenerator.cs
- DesignTimeSiteMapProvider.cs
- DateTimeSerializationSection.cs
- GestureRecognizer.cs
- log.cs
- TrackBar.cs
- PartialTrustHelpers.cs
- StatusBarDrawItemEvent.cs
- Color.cs
- ProcessHost.cs
- HttpListenerElement.cs
- HtmlMeta.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ArraySubsetEnumerator.cs
- EntityConnection.cs
- HtmlControlDesigner.cs
- TrackingConditionCollection.cs
- SrgsRule.cs
- WebControlAdapter.cs
- RedistVersionInfo.cs
- XmlQueryCardinality.cs
- XmlElementAttribute.cs
- TraceRecords.cs
- OpenTypeLayout.cs
- FormViewUpdatedEventArgs.cs
- TypeName.cs
- SqlUdtInfo.cs
- ActiveXHost.cs
- XmlSchemaInferenceException.cs
- DbParameterCollection.cs
- ListBoxAutomationPeer.cs
- XamlSerializer.cs
- AddInAttribute.cs
- unsafeIndexingFilterStream.cs
- TableRow.cs
- Missing.cs
- ContainerParaClient.cs
- CapabilitiesAssignment.cs
- ProcessHostMapPath.cs
- BitmapEffectInputData.cs
- RelationHandler.cs
- AsymmetricAlgorithm.cs
- XmlNotation.cs
- DomNameTable.cs