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
- ControlBuilderAttribute.cs
- EntityDataSourceContainerNameItem.cs
- ApplicationServicesHostFactory.cs
- FrameworkObject.cs
- AccessDataSourceView.cs
- WebPartConnectionsCancelEventArgs.cs
- ResourceWriter.cs
- FileLevelControlBuilderAttribute.cs
- UnsafeNativeMethods.cs
- RectangleGeometry.cs
- BasicHttpMessageSecurity.cs
- ConnectionPointGlyph.cs
- Animatable.cs
- PropertyCollection.cs
- SqlDeflator.cs
- ObjectStorage.cs
- WmiPutTraceRecord.cs
- OrthographicCamera.cs
- GacUtil.cs
- ReturnType.cs
- Margins.cs
- RealizationContext.cs
- WorkflowLayouts.cs
- HttpModuleCollection.cs
- XmlLoader.cs
- TranslateTransform3D.cs
- FixedPosition.cs
- XmlReflectionImporter.cs
- TagNameToTypeMapper.cs
- SuppressMessageAttribute.cs
- AppDomainUnloadedException.cs
- ThreadPool.cs
- MatrixKeyFrameCollection.cs
- CacheMode.cs
- TableRow.cs
- WebSysDescriptionAttribute.cs
- StorageAssociationTypeMapping.cs
- LockRenewalTask.cs
- FormsAuthenticationTicket.cs
- PhysicalFontFamily.cs
- PropertyBuilder.cs
- MatrixConverter.cs
- IconBitmapDecoder.cs
- PathHelper.cs
- HitTestFilterBehavior.cs
- X509Certificate2.cs
- StreamGeometryContext.cs
- RegexCompiler.cs
- LineServicesRun.cs
- SettingsPropertyWrongTypeException.cs
- SafeNativeMemoryHandle.cs
- SequenceNumber.cs
- ShapeTypeface.cs
- EventLogPermissionAttribute.cs
- ClientConfigPaths.cs
- FirstQueryOperator.cs
- SafeFileMappingHandle.cs
- FixedSOMPageElement.cs
- TextFragmentEngine.cs
- NamespaceCollection.cs
- ItemContainerProviderWrapper.cs
- DataGridViewAccessibleObject.cs
- ExpressionBindingCollection.cs
- Filter.cs
- ToolStripLabel.cs
- Single.cs
- CodeExpressionCollection.cs
- Process.cs
- UseLicense.cs
- DataGridView.cs
- WebControlsSection.cs
- CapabilitiesSection.cs
- HttpCacheVaryByContentEncodings.cs
- TextEditorDragDrop.cs
- HideDisabledControlAdapter.cs
- UnsafeNativeMethods.cs
- TcpServerChannel.cs
- HandlerFactoryCache.cs
- InputProcessorProfilesLoader.cs
- MdiWindowListItemConverter.cs
- DesignerVerb.cs
- Decimal.cs
- Inflater.cs
- UnsafeNativeMethods.cs
- OracleBinary.cs
- FormViewDeletedEventArgs.cs
- Semaphore.cs
- TimerEventSubscription.cs
- OdbcTransaction.cs
- ActivationArguments.cs
- TraceSource.cs
- ConstraintStruct.cs
- WebPartVerbCollection.cs
- PostBackTrigger.cs
- DocumentViewerBaseAutomationPeer.cs
- SrgsGrammarCompiler.cs
- MergeFilterQuery.cs
- Rect.cs
- Scheduling.cs
- ExpressionContext.cs