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
- SortedList.cs
- HttpException.cs
- FormClosingEvent.cs
- BatchStream.cs
- SafeNativeMethods.cs
- ValueProviderWrapper.cs
- StyleReferenceConverter.cs
- ContextMarshalException.cs
- MsmqActivation.cs
- AppSettingsExpressionBuilder.cs
- LoginStatusDesigner.cs
- Html32TextWriter.cs
- OdbcConnectionStringbuilder.cs
- EdmScalarPropertyAttribute.cs
- DataServicePagingProviderWrapper.cs
- _FtpControlStream.cs
- StructuredType.cs
- ColumnPropertiesGroup.cs
- DataColumnMapping.cs
- PasswordRecoveryDesigner.cs
- Comparer.cs
- followingquery.cs
- SafeReversePInvokeHandle.cs
- ErrorStyle.cs
- MouseCaptureWithinProperty.cs
- InfoCardProofToken.cs
- ColumnBinding.cs
- __TransparentProxy.cs
- URLAttribute.cs
- cache.cs
- StdValidatorsAndConverters.cs
- RemotingException.cs
- TextMetrics.cs
- ProcessHostMapPath.cs
- SafeHandles.cs
- ColumnClickEvent.cs
- LongTypeConverter.cs
- MaterializeFromAtom.cs
- ToolTip.cs
- AssemblySettingAttributes.cs
- Size.cs
- ToolStripDropDownMenu.cs
- regiisutil.cs
- DBSchemaTable.cs
- ISFClipboardData.cs
- DBCommand.cs
- DebugControllerThread.cs
- CaseKeyBox.xaml.cs
- OleDbDataReader.cs
- MarshalDirectiveException.cs
- MachineSettingsSection.cs
- NameTable.cs
- SafeNativeMethods.cs
- CodeDomDecompiler.cs
- ReadContentAsBinaryHelper.cs
- DesignConnectionCollection.cs
- ToolStripItemBehavior.cs
- ArithmeticException.cs
- CheckBox.cs
- SimpleLine.cs
- HashSetDebugView.cs
- Dispatcher.cs
- PointLightBase.cs
- Expressions.cs
- NativeMethods.cs
- QuadraticBezierSegment.cs
- DataBinding.cs
- smtpconnection.cs
- ZoomPercentageConverter.cs
- CacheAxisQuery.cs
- ConfigurationSectionGroupCollection.cs
- DATA_BLOB.cs
- StateInitialization.cs
- NullReferenceException.cs
- ZipIOCentralDirectoryFileHeader.cs
- SimpleHandlerFactory.cs
- BaseParser.cs
- SqlClientWrapperSmiStreamChars.cs
- UnsafeNativeMethods.cs
- StringOutput.cs
- NativeMethods.cs
- Scheduler.cs
- XmlResolver.cs
- TdsRecordBufferSetter.cs
- SafePEFileHandle.cs
- SurrogateEncoder.cs
- NameSpaceEvent.cs
- EventToken.cs
- UntrustedRecipientException.cs
- SafeSystemMetrics.cs
- ReflectionServiceProvider.cs
- PriorityItem.cs
- HttpSessionStateWrapper.cs
- NativeMethods.cs
- XmlEncodedRawTextWriter.cs
- SrgsElementFactory.cs
- GenerateTemporaryTargetAssembly.cs
- DocumentSchemaValidator.cs
- OdbcParameter.cs
- TypeSystemProvider.cs