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
- Image.cs
- OdbcParameter.cs
- SafeNativeMethods.cs
- AttachedPropertyDescriptor.cs
- StyleConverter.cs
- ProxySimple.cs
- X509Chain.cs
- VersionedStreamOwner.cs
- NamespaceInfo.cs
- LambdaCompiler.Unary.cs
- PointCollection.cs
- PipelineComponent.cs
- RelatedImageListAttribute.cs
- DefaultAssemblyResolver.cs
- ModelUIElement3D.cs
- NumericUpDown.cs
- HwndKeyboardInputProvider.cs
- COM2IProvidePropertyBuilderHandler.cs
- ZipIOLocalFileBlock.cs
- QueryCacheKey.cs
- IIS7WorkerRequest.cs
- URLString.cs
- DataServiceKeyAttribute.cs
- IdentityValidationException.cs
- DynamicValueConverter.cs
- CriticalFinalizerObject.cs
- TextRunCacheImp.cs
- DeviceContext2.cs
- ReadOnlyObservableCollection.cs
- HuffmanTree.cs
- XmlSchemaAttributeGroup.cs
- InkPresenterAutomationPeer.cs
- CmsInterop.cs
- Control.cs
- UInt32Storage.cs
- ComNativeDescriptor.cs
- IfAction.cs
- WebPartRestoreVerb.cs
- TextMarkerSource.cs
- DesignerDeviceConfig.cs
- DiscoveryDocumentLinksPattern.cs
- FilePresentation.cs
- SamlAuthorizationDecisionClaimResource.cs
- Color.cs
- SoundPlayer.cs
- StorageEntitySetMapping.cs
- WebPartCloseVerb.cs
- LabelTarget.cs
- FormViewInsertedEventArgs.cs
- UncommonField.cs
- SqlFactory.cs
- PerspectiveCamera.cs
- PolyLineSegment.cs
- ExtenderControl.cs
- ManagedCodeMarkers.cs
- PreProcessor.cs
- SoapAttributeOverrides.cs
- ConfigsHelper.cs
- FixedSOMTable.cs
- MailWriter.cs
- HttpWrapper.cs
- SemanticBasicElement.cs
- XmlExpressionDumper.cs
- WCFServiceClientProxyGenerator.cs
- SolidBrush.cs
- DebuggerAttributes.cs
- XMLDiffLoader.cs
- CompositeFontFamily.cs
- FilterEventArgs.cs
- HitTestDrawingContextWalker.cs
- _TimerThread.cs
- List.cs
- DbConnectionHelper.cs
- LoginDesignerUtil.cs
- NonSerializedAttribute.cs
- BufferModeSettings.cs
- StylusPoint.cs
- AuthenticateEventArgs.cs
- _TimerThread.cs
- LogEntryDeserializer.cs
- PagePropertiesChangingEventArgs.cs
- CodeNamespaceImport.cs
- SqlBuffer.cs
- SelectionRange.cs
- SearchForVirtualItemEventArgs.cs
- LongValidator.cs
- BamlBinaryWriter.cs
- PeerPresenceInfo.cs
- HMACMD5.cs
- CodeArrayCreateExpression.cs
- DataRelationPropertyDescriptor.cs
- ByteStorage.cs
- ManagedFilter.cs
- SourceFileBuildProvider.cs
- SectionInformation.cs
- PageAsyncTaskManager.cs
- PanningMessageFilter.cs
- TextProperties.cs
- PropertyCollection.cs
- ReadOnlyCollection.cs