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
- DetailsViewDesigner.cs
- ObjectDataSourceEventArgs.cs
- WorkflowInstanceContextProvider.cs
- FileSystemInfo.cs
- Lasso.cs
- DtcInterfaces.cs
- MetadataUtilsSmi.cs
- OdbcConnectionHandle.cs
- NamedPermissionSet.cs
- GeneratedContractType.cs
- BrushMappingModeValidation.cs
- ColorConvertedBitmapExtension.cs
- EdmScalarPropertyAttribute.cs
- PropertyCondition.cs
- Restrictions.cs
- Rules.cs
- ListBoxAutomationPeer.cs
- Transform3DGroup.cs
- RadioButtonFlatAdapter.cs
- Package.cs
- OutputCacheSettings.cs
- XhtmlCssHandler.cs
- ResourceDisplayNameAttribute.cs
- EncryptedPackage.cs
- SizeConverter.cs
- WebFaultClientMessageInspector.cs
- ManagedFilter.cs
- DBNull.cs
- JoinCqlBlock.cs
- EventTrigger.cs
- localization.cs
- BitmapPalettes.cs
- XmlSchemaSimpleTypeList.cs
- XPathNodeIterator.cs
- HighContrastHelper.cs
- XdrBuilder.cs
- ComContractElementCollection.cs
- PassportAuthenticationModule.cs
- ByteStreamMessageEncoderFactory.cs
- Window.cs
- TraceSection.cs
- RequestValidator.cs
- ObjectStateEntryDbDataRecord.cs
- ApplicationHost.cs
- InputLanguageProfileNotifySink.cs
- FunctionQuery.cs
- FixedTextView.cs
- DataBinder.cs
- ClientTargetSection.cs
- WasAdminWrapper.cs
- CounterCreationData.cs
- WSHttpTransportSecurityElement.cs
- XmlDataSourceView.cs
- ClientTarget.cs
- RegexTree.cs
- SelectedGridItemChangedEvent.cs
- TextEndOfSegment.cs
- IisTraceListener.cs
- SiteMapNodeCollection.cs
- WindowsAuthenticationModule.cs
- assertwrapper.cs
- BooleanAnimationBase.cs
- ComplexPropertyEntry.cs
- WsrmFault.cs
- ResourceDefaultValueAttribute.cs
- GeneratedContractType.cs
- WebPartDisplayModeCancelEventArgs.cs
- ServiceNameElementCollection.cs
- ScriptingWebServicesSectionGroup.cs
- Stylesheet.cs
- OutputCacheSettings.cs
- ColorTransform.cs
- BindingNavigator.cs
- AsyncSerializedWorker.cs
- EntityDataSourceReferenceGroup.cs
- ValidationSummaryDesigner.cs
- DecimalAnimation.cs
- RequestCacheEntry.cs
- EncodingDataItem.cs
- FindCompletedEventArgs.cs
- FontWeight.cs
- XpsS0ValidatingLoader.cs
- XPathAncestorQuery.cs
- HtmlLink.cs
- TdsParserSessionPool.cs
- KeySpline.cs
- Matrix3D.cs
- SqlErrorCollection.cs
- FusionWrap.cs
- InteropExecutor.cs
- XmlSerializerNamespaces.cs
- MetadataPropertyvalue.cs
- DynamicArgumentDialog.cs
- IdentityNotMappedException.cs
- ListBoxItemWrapperAutomationPeer.cs
- TiffBitmapEncoder.cs
- ListViewGroupItemCollection.cs
- CheckBox.cs
- Label.cs
- ExceptionUtil.cs