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
- UInt64Storage.cs
- TextTreePropertyUndoUnit.cs
- IdentifierService.cs
- TextRangeSerialization.cs
- RawStylusSystemGestureInputReport.cs
- MultilineStringConverter.cs
- Oci.cs
- PageAsyncTask.cs
- SqlBulkCopyColumnMappingCollection.cs
- DataGridViewCheckBoxCell.cs
- UnmanagedHandle.cs
- MessagePropertyVariants.cs
- TextSelectionProcessor.cs
- CodeRegionDirective.cs
- xmlglyphRunInfo.cs
- ActiveXHelper.cs
- Margins.cs
- CodeAttachEventStatement.cs
- XPathExpr.cs
- UTF32Encoding.cs
- SimpleMailWebEventProvider.cs
- InputScopeAttribute.cs
- EntityModelSchemaGenerator.cs
- DataGridClipboardHelper.cs
- ContextMenuStrip.cs
- RequestCacheValidator.cs
- InvalidEnumArgumentException.cs
- HtmlTextArea.cs
- PolyBezierSegmentFigureLogic.cs
- XmlSignatureManifest.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- NumericUpDown.cs
- DocumentPageViewAutomationPeer.cs
- Renderer.cs
- DelegatingConfigHost.cs
- Empty.cs
- FrameworkRichTextComposition.cs
- KeyedCollection.cs
- TextElementEditingBehaviorAttribute.cs
- AccessDataSource.cs
- DataGridViewSortCompareEventArgs.cs
- StrokeNodeOperations2.cs
- MarshalDirectiveException.cs
- Style.cs
- PassportAuthentication.cs
- TemplateBaseAction.cs
- IfAction.cs
- DataServiceClientException.cs
- PtsPage.cs
- FixedPage.cs
- ProxyAttribute.cs
- NavigationProgressEventArgs.cs
- WindowsProgressbar.cs
- TaskHelper.cs
- HtmlEncodedRawTextWriter.cs
- SymbolPair.cs
- WebBrowserUriTypeConverter.cs
- HwndSourceKeyboardInputSite.cs
- UInt16Storage.cs
- unsafenativemethodstextservices.cs
- ByteStream.cs
- AsyncOperationManager.cs
- MediaSystem.cs
- WsdlWriter.cs
- OracleTransaction.cs
- DataPointer.cs
- UnauthorizedAccessException.cs
- SapiRecoContext.cs
- ItemsControlAutomationPeer.cs
- Timeline.cs
- ProfileInfo.cs
- DataBindingCollection.cs
- ObjectIDGenerator.cs
- IssuanceLicense.cs
- RelatedCurrencyManager.cs
- DispatcherObject.cs
- TextBoxBase.cs
- DataStorage.cs
- CheckPair.cs
- ExtendedPropertyInfo.cs
- Char.cs
- FixedElement.cs
- ToolStripItemGlyph.cs
- HttpContextServiceHost.cs
- LazyTextWriterCreator.cs
- LocalizableResourceBuilder.cs
- CompressedStack.cs
- BitStream.cs
- MemberInfoSerializationHolder.cs
- SoapRpcServiceAttribute.cs
- CategoryNameCollection.cs
- DecimalAnimationUsingKeyFrames.cs
- RenameRuleObjectDialog.cs
- WebPartsPersonalization.cs
- DataGridLinkButton.cs
- _CommandStream.cs
- XmlSchemaInfo.cs
- BitmapEffectInputData.cs
- MailWebEventProvider.cs
- ViewKeyConstraint.cs