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
- FamilyMapCollection.cs
- DocumentApplication.cs
- MemberMemberBinding.cs
- Brush.cs
- BuildProvider.cs
- CodeAttributeDeclarationCollection.cs
- PathStreamGeometryContext.cs
- DrawingImage.cs
- GridViewRowEventArgs.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ServiceInfo.cs
- XmlSchemaAnnotation.cs
- _ShellExpression.cs
- LinkUtilities.cs
- __Error.cs
- IdentityManager.cs
- Activator.cs
- MD5Cng.cs
- SqlErrorCollection.cs
- HashSetEqualityComparer.cs
- CodeDirectionExpression.cs
- DeferredTextReference.cs
- WindowsGraphicsCacheManager.cs
- Int64KeyFrameCollection.cs
- XPathPatternParser.cs
- TransactionScope.cs
- X509Certificate.cs
- CheckBoxRenderer.cs
- DbProviderServices.cs
- RectangleHotSpot.cs
- InternalsVisibleToAttribute.cs
- XmlCodeExporter.cs
- UnknownBitmapDecoder.cs
- XamlParser.cs
- ObjectStateEntryDbDataRecord.cs
- ActivationServices.cs
- BindingFormattingDialog.cs
- datacache.cs
- LiteralTextContainerControlBuilder.cs
- HttpRawResponse.cs
- ArglessEventHandlerProxy.cs
- TextServicesHost.cs
- AssemblyAttributes.cs
- DSASignatureFormatter.cs
- BrushProxy.cs
- typedescriptorpermission.cs
- RepeaterCommandEventArgs.cs
- ColumnResizeAdorner.cs
- ItemCheckedEvent.cs
- ThousandthOfEmRealDoubles.cs
- ISAPIRuntime.cs
- DefaultMemberAttribute.cs
- StringDictionary.cs
- PasswordDeriveBytes.cs
- Object.cs
- BitmapScalingModeValidation.cs
- ObjectSecurity.cs
- NativeMethods.cs
- XmlSchemaType.cs
- EntityWrapper.cs
- FixedSOMPageConstructor.cs
- ProxyManager.cs
- FormsAuthentication.cs
- PerfService.cs
- xdrvalidator.cs
- WizardPanelChangingEventArgs.cs
- DigitShape.cs
- InProcStateClientManager.cs
- TextWriterTraceListener.cs
- CatalogPartChrome.cs
- LinqExpressionNormalizer.cs
- RotateTransform3D.cs
- FontUnit.cs
- EntityContainerRelationshipSetEnd.cs
- SiteMapDataSourceView.cs
- PrivilegeNotHeldException.cs
- UIElementCollection.cs
- DragCompletedEventArgs.cs
- XmlReflectionImporter.cs
- HashCodeCombiner.cs
- ServiceMemoryGates.cs
- ILGenerator.cs
- ConfigurationValidatorAttribute.cs
- RichTextBox.cs
- RootNamespaceAttribute.cs
- DataGridItemAttachedStorage.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DateTimeConstantAttribute.cs
- ValidationErrorEventArgs.cs
- InputLanguageEventArgs.cs
- GridView.cs
- SHA1.cs
- AsyncStreamReader.cs
- SqlWebEventProvider.cs
- QueryStringHandler.cs
- DataObjectSettingDataEventArgs.cs
- InvokeGenerator.cs
- CommonXSendMessage.cs
- ToolStripSplitStackLayout.cs
- BufferedReceiveManager.cs