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 / RichTextBoxAutomationPeer.cs / 1 / RichTextBoxAutomationPeer.cs
using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Interop; using System.Windows.Media; using MS.Internal.Documents; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class RichTextBoxAutomationPeer : TextAutomationPeer { /// public RichTextBoxAutomationPeer(RichTextBox owner): base(owner) {} /// override protected string GetClassNameCore() { return "RichTextBox"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Document; } /// override public object GetPattern(PatternInterface patternInterface) { object returnValue = null; RichTextBox owner = (RichTextBox)Owner; if (patternInterface == PatternInterface.Text) { returnValue = new MS.Internal.Automation.TextAdaptor(this, owner.TextContainer); } if (patternInterface == PatternInterface.Scroll) { if (owner.ScrollViewer != null) { returnValue = owner.ScrollViewer.CreateAutomationPeer(); ((AutomationPeer)returnValue).EventsSource = this; } } return returnValue; } ////// protected override List/// GetChildrenCore() { RichTextBox owner = (RichTextBox)Owner; return TextContainerHelper.GetAutomationPeersFromRange(owner.TextContainer.Start, owner.TextContainer.End, null); } /// /// Gets collection of AutomationPeers for given text range. /// internal override ListGetAutomationPeersFromRange(ITextPointer start, ITextPointer end) { // Force children connection to automation tree. GetChildren(); RichTextBox owner = (RichTextBox)Owner; return TextContainerHelper.GetAutomationPeersFromRange(start, end, owner.TextContainer.Start); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Interop; using System.Windows.Media; using MS.Internal.Documents; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class RichTextBoxAutomationPeer : TextAutomationPeer { /// public RichTextBoxAutomationPeer(RichTextBox owner): base(owner) {} /// override protected string GetClassNameCore() { return "RichTextBox"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Document; } /// override public object GetPattern(PatternInterface patternInterface) { object returnValue = null; RichTextBox owner = (RichTextBox)Owner; if (patternInterface == PatternInterface.Text) { returnValue = new MS.Internal.Automation.TextAdaptor(this, owner.TextContainer); } if (patternInterface == PatternInterface.Scroll) { if (owner.ScrollViewer != null) { returnValue = owner.ScrollViewer.CreateAutomationPeer(); ((AutomationPeer)returnValue).EventsSource = this; } } return returnValue; } /// /// protected override List/// GetChildrenCore() { RichTextBox owner = (RichTextBox)Owner; return TextContainerHelper.GetAutomationPeersFromRange(owner.TextContainer.Start, owner.TextContainer.End, null); } /// /// Gets collection of AutomationPeers for given text range. /// internal override ListGetAutomationPeersFromRange(ITextPointer start, ITextPointer end) { // Force children connection to automation tree. GetChildren(); RichTextBox owner = (RichTextBox)Owner; return TextContainerHelper.GetAutomationPeersFromRange(start, end, owner.TextContainer.Start); } } } // 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
- TypeElement.cs
- FormClosedEvent.cs
- FixedDocument.cs
- DataError.cs
- TextServicesHost.cs
- RoleManagerModule.cs
- HotSpot.cs
- DateTimeParse.cs
- FixedTextBuilder.cs
- RichTextBoxDesigner.cs
- _ConnectionGroup.cs
- RelationshipWrapper.cs
- InternalRelationshipCollection.cs
- QueryResponse.cs
- EventLogPermissionAttribute.cs
- ThreadExceptionEvent.cs
- BinaryConverter.cs
- ProxyGenerationError.cs
- TextEffectResolver.cs
- BitmapDownload.cs
- UserUseLicenseDictionaryLoader.cs
- XmlWellformedWriterHelpers.cs
- VectorAnimationBase.cs
- SpotLight.cs
- LazyTextWriterCreator.cs
- RelationshipEntry.cs
- OneOfElement.cs
- TreeNodeCollection.cs
- SelectorAutomationPeer.cs
- DecimalAnimationBase.cs
- DaylightTime.cs
- XmlDocumentSerializer.cs
- CommandHelper.cs
- SafeMILHandle.cs
- XmlAttributeProperties.cs
- TableTextElementCollectionInternal.cs
- ContentType.cs
- PasswordBox.cs
- XamlTypeMapper.cs
- IPAddressCollection.cs
- TransportBindingElementImporter.cs
- UrlMappingCollection.cs
- QuestionEventArgs.cs
- _SecureChannel.cs
- TreeViewCancelEvent.cs
- HelpKeywordAttribute.cs
- NetTcpSecurityElement.cs
- FixedSOMGroup.cs
- SystemThemeKey.cs
- SqlUnionizer.cs
- RowParagraph.cs
- ExpressionNormalizer.cs
- hresults.cs
- AdRotatorDesigner.cs
- NamespaceCollection.cs
- RubberbandSelector.cs
- DataGridHelper.cs
- GenericEnumConverter.cs
- ListDictionary.cs
- NameValueConfigurationElement.cs
- PerformanceCounterManager.cs
- CultureMapper.cs
- ConnectionPointGlyph.cs
- EncoderExceptionFallback.cs
- Root.cs
- CodeDomDesignerLoader.cs
- ContentPropertyAttribute.cs
- Configuration.cs
- RegionIterator.cs
- AspCompat.cs
- Timer.cs
- ClientRoleProvider.cs
- _ConnectionGroup.cs
- CodeArrayIndexerExpression.cs
- AvTraceFormat.cs
- DiscoveryDocumentLinksPattern.cs
- SplineKeyFrames.cs
- NativeCppClassAttribute.cs
- BitmapEncoder.cs
- BuildProviderAppliesToAttribute.cs
- SwitchCase.cs
- ProgressBarRenderer.cs
- HttpContext.cs
- MouseGesture.cs
- TypeValidationEventArgs.cs
- DataTableReader.cs
- SplineQuaternionKeyFrame.cs
- ReadWriteObjectLock.cs
- ListViewItem.cs
- GridLength.cs
- HierarchicalDataBoundControl.cs
- XmlRawWriter.cs
- WebCodeGenerator.cs
- TextRangeProviderWrapper.cs
- InlineUIContainer.cs
- FilterEventArgs.cs
- FileDetails.cs
- SynchronizedKeyedCollection.cs
- InsufficientMemoryException.cs
- DataFormat.cs