Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DeferredTextReference.cs / 1305600 / DeferredTextReference.cs
//---------------------------------------------------------------------------- // // File: DeferredTextReference.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Proxy object passed to the property system to delay load // TextProperty values. // //--------------------------------------------------------------------------- namespace System.Windows.Controls { using System.Windows.Documents; // Proxy object passed to the property system to delay load TextProperty // values. internal class DeferredTextReference : DeferredReference { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal DeferredTextReference(ITextContainer textContainer) { _textContainer = textContainer; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods // Does the real work to calculate the current TextProperty value. internal override object GetValue(BaseValueSourceInternal valueSource) { string s = TextRangeBase.GetTextInternal(_textContainer.Start, _textContainer.End); TextBox tb = _textContainer.Parent as TextBox; if (tb != null) { tb.OnDeferredTextReferenceResolved(this, s); } return s; } // Gets the type of the value it represents internal override Type GetValueType() { return typeof(string); } #endregion Internal Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // TextContainer mapped to this object. private readonly ITextContainer _textContainer; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: DeferredTextReference.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Proxy object passed to the property system to delay load // TextProperty values. // //--------------------------------------------------------------------------- namespace System.Windows.Controls { using System.Windows.Documents; // Proxy object passed to the property system to delay load TextProperty // values. internal class DeferredTextReference : DeferredReference { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal DeferredTextReference(ITextContainer textContainer) { _textContainer = textContainer; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods // Does the real work to calculate the current TextProperty value. internal override object GetValue(BaseValueSourceInternal valueSource) { string s = TextRangeBase.GetTextInternal(_textContainer.Start, _textContainer.End); TextBox tb = _textContainer.Parent as TextBox; if (tb != null) { tb.OnDeferredTextReferenceResolved(this, s); } return s; } // Gets the type of the value it represents internal override Type GetValueType() { return typeof(string); } #endregion Internal Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // TextContainer mapped to this object. private readonly ITextContainer _textContainer; #endregion Private Fields } } // 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
- SafeNativeHandle.cs
- GridToolTip.cs
- FileNameEditor.cs
- GacUtil.cs
- FramingFormat.cs
- GatewayDefinition.cs
- DirectoryInfo.cs
- WebSysDescriptionAttribute.cs
- DataSetSchema.cs
- TaskFileService.cs
- SQLInt64.cs
- DeclarativeExpressionConditionDeclaration.cs
- GZipStream.cs
- AudioLevelUpdatedEventArgs.cs
- MsmqHostedTransportManager.cs
- UiaCoreProviderApi.cs
- LineBreakRecord.cs
- BinaryOperationBinder.cs
- AnimationClock.cs
- SiteMapDataSource.cs
- ThreadStaticAttribute.cs
- FontWeight.cs
- ConnectionInterfaceCollection.cs
- SqlServer2KCompatibilityAnnotation.cs
- WindowsTab.cs
- TreeSet.cs
- TimeSpanValidator.cs
- DebugTracing.cs
- WinFormsComponentEditor.cs
- FileLogRecordEnumerator.cs
- SocketPermission.cs
- Cloud.cs
- DataGridTextBox.cs
- CaseStatementSlot.cs
- PerformanceCounterPermissionAttribute.cs
- TemplateBindingExtension.cs
- InternalConfigSettingsFactory.cs
- UIElementParaClient.cs
- SocketInformation.cs
- CellParagraph.cs
- EventsTab.cs
- PlatformNotSupportedException.cs
- CapabilitiesAssignment.cs
- UpdateExpressionVisitor.cs
- GridLength.cs
- DBParameter.cs
- ImageMap.cs
- HttpRuntimeSection.cs
- XmlArrayItemAttributes.cs
- DbConnectionPoolCounters.cs
- StatusBarDesigner.cs
- FileStream.cs
- LambdaCompiler.Statements.cs
- CollectionBuilder.cs
- Win32KeyboardDevice.cs
- ArcSegment.cs
- WindowsFormsSectionHandler.cs
- XmlNamespaceDeclarationsAttribute.cs
- Process.cs
- base64Transforms.cs
- FixedSOMTextRun.cs
- BitmapEffectInput.cs
- RuleSetCollection.cs
- BindingBase.cs
- ProgramNode.cs
- RegexGroup.cs
- BuildProviderAppliesToAttribute.cs
- ScrollBarAutomationPeer.cs
- BrowserCapabilitiesFactory35.cs
- DispatchWrapper.cs
- CaseCqlBlock.cs
- ObjectDataSourceView.cs
- _NestedMultipleAsyncResult.cs
- DoubleAnimationBase.cs
- OperationFormatStyle.cs
- SelfIssuedAuthRSACryptoProvider.cs
- PropertyChangedEventManager.cs
- ColorContextHelper.cs
- AssemblyInfo.cs
- XmlSchemaIdentityConstraint.cs
- MapPathBasedVirtualPathProvider.cs
- GroupBox.cs
- PagesChangedEventArgs.cs
- Int32EqualityComparer.cs
- MultiPropertyDescriptorGridEntry.cs
- DrawingContextWalker.cs
- PolicyValidationException.cs
- Compiler.cs
- TextRunCacheImp.cs
- CodeTypeParameterCollection.cs
- EntityDataSourceStatementEditor.cs
- Utils.cs
- SoapExtensionTypeElementCollection.cs
- Utility.cs
- PermissionListSet.cs
- SqlServices.cs
- SessionStateModule.cs
- Sql8ExpressionRewriter.cs
- SecurityTokenException.cs
- DefaultTextStoreTextComposition.cs