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
- SerializationException.cs
- XmlSchemaGroup.cs
- Journal.cs
- RuntimeIdentifierPropertyAttribute.cs
- DataControlField.cs
- VisualBasicSettingsConverter.cs
- ConfigurationValidatorAttribute.cs
- ByteStack.cs
- DBConcurrencyException.cs
- ObjectViewFactory.cs
- SQLSingleStorage.cs
- ExpressionBinding.cs
- CollectionViewGroup.cs
- SecurityKeyIdentifierClause.cs
- Win32PrintDialog.cs
- HuffCodec.cs
- DataServiceContext.cs
- TrackBar.cs
- WebPartEditorOkVerb.cs
- FileSecurity.cs
- ObjectStateEntryDbDataRecord.cs
- TimeSpanStorage.cs
- SQLChars.cs
- FixedSOMGroup.cs
- ChtmlImageAdapter.cs
- InstanceLockQueryResult.cs
- TextStore.cs
- PerformanceCounterPermissionEntry.cs
- SchemaCollectionPreprocessor.cs
- __Filters.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- DiscoveryClientReferences.cs
- Stack.cs
- BindingContext.cs
- initElementDictionary.cs
- SemanticBasicElement.cs
- FrameworkElementAutomationPeer.cs
- AsymmetricSignatureFormatter.cs
- ManageRequest.cs
- LockRecursionException.cs
- CustomCategoryAttribute.cs
- ListenerAdaptersInstallComponent.cs
- UIElementHelper.cs
- RuntimeHandles.cs
- AuthenticationModuleElement.cs
- StylusPointDescription.cs
- EastAsianLunisolarCalendar.cs
- ToolStripDropDownItemDesigner.cs
- WebSysDescriptionAttribute.cs
- WebPartDescription.cs
- log.cs
- PolicyLevel.cs
- SharedDp.cs
- MouseBinding.cs
- FileUtil.cs
- SqlBooleanMismatchVisitor.cs
- WeakReference.cs
- ButtonBaseAutomationPeer.cs
- AssertFilter.cs
- PeekCompletedEventArgs.cs
- BasicHttpSecurity.cs
- WorkflowRuntimeSection.cs
- CultureTable.cs
- FormatException.cs
- XmlFormatExtensionAttribute.cs
- TreeNodeCollectionEditor.cs
- Cursor.cs
- ImageEditor.cs
- SQLBytes.cs
- NumberFormatInfo.cs
- XmlHierarchicalEnumerable.cs
- HtmlDocument.cs
- ComponentManagerBroker.cs
- GrammarBuilderDictation.cs
- TransformerInfoCollection.cs
- LazyInitializer.cs
- remotingproxy.cs
- ServiceElementCollection.cs
- InputEventArgs.cs
- ChtmlTextWriter.cs
- UIHelper.cs
- TraceSection.cs
- ZipFileInfoCollection.cs
- ExpressionVisitor.cs
- ByteStack.cs
- SponsorHelper.cs
- OrderedDictionaryStateHelper.cs
- NamespaceTable.cs
- ObjectStateManagerMetadata.cs
- ConversionContext.cs
- LockCookie.cs
- ContentFilePart.cs
- RuleSettingsCollection.cs
- HtmlFormWrapper.cs
- AttributeUsageAttribute.cs
- ThemeInfoAttribute.cs
- DataGridRowClipboardEventArgs.cs
- EventProvider.cs
- IndexedString.cs
- RelationshipConstraintValidator.cs