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
- Converter.cs
- WmlPageAdapter.cs
- ActivationServices.cs
- InternalBufferOverflowException.cs
- NonClientArea.cs
- CloseSequenceResponse.cs
- ToolStripItemCollection.cs
- UnSafeCharBuffer.cs
- CheckBoxList.cs
- FormsAuthenticationUserCollection.cs
- UserMapPath.cs
- BaseEntityWrapper.cs
- TextModifier.cs
- StringUtil.cs
- Trace.cs
- ErrorItem.cs
- QuestionEventArgs.cs
- Drawing.cs
- SimpleTextLine.cs
- DataGridViewLayoutData.cs
- OptionalRstParameters.cs
- Atom10FormatterFactory.cs
- System.Data.OracleClient_BID.cs
- XsltSettings.cs
- WSTrustDec2005.cs
- Encoder.cs
- SqlDependencyUtils.cs
- WindowsListViewGroupHelper.cs
- FacetChecker.cs
- KernelTypeValidation.cs
- HttpCapabilitiesBase.cs
- NavigateEvent.cs
- FragmentQueryProcessor.cs
- ErrorRuntimeConfig.cs
- __ConsoleStream.cs
- QuaternionRotation3D.cs
- BatchStream.cs
- ArgumentNullException.cs
- Baml2006ReaderSettings.cs
- FormsAuthenticationUserCollection.cs
- EventBuilder.cs
- SqlClientPermission.cs
- BinaryParser.cs
- VirtualizedCellInfoCollection.cs
- SafeNativeMethodsCLR.cs
- WebPartConnectionsCancelEventArgs.cs
- JsonObjectDataContract.cs
- HtmlElementEventArgs.cs
- SplayTreeNode.cs
- TypeCacheManager.cs
- DragDeltaEventArgs.cs
- DynamicDocumentPaginator.cs
- SafeReadContext.cs
- Crc32.cs
- ListCollectionView.cs
- ClientType.cs
- CodeAccessPermission.cs
- MasterPage.cs
- OdbcUtils.cs
- TextBox.cs
- ArgumentOutOfRangeException.cs
- VisualStyleTypesAndProperties.cs
- SchemaNamespaceManager.cs
- XsdValidatingReader.cs
- WorkItem.cs
- CompilerLocalReference.cs
- VersionedStream.cs
- ApplicationSecurityInfo.cs
- ComponentChangedEvent.cs
- PageTheme.cs
- IsolatedStorageFileStream.cs
- BasicBrowserDialog.designer.cs
- ValidatorCompatibilityHelper.cs
- MessageDescription.cs
- TemplatedMailWebEventProvider.cs
- AuthenticationConfig.cs
- ToolStripDropDownButton.cs
- WebPartUtil.cs
- BindingExpressionUncommonField.cs
- EnumBuilder.cs
- Version.cs
- NonParentingControl.cs
- COM2FontConverter.cs
- ClientUtils.cs
- ObjectStateEntry.cs
- DataTableExtensions.cs
- TraceFilter.cs
- FormDesigner.cs
- ImageMap.cs
- CompositeDataBoundControl.cs
- ParserOptions.cs
- TaskFormBase.cs
- GZipUtils.cs
- BStrWrapper.cs
- CellCreator.cs
- HandleCollector.cs
- QilPatternFactory.cs
- Knowncolors.cs
- ReachVisualSerializer.cs
- AuthenticateEventArgs.cs