Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / BlockUIContainer.cs / 1305600 / BlockUIContainer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: BlockUIContainer - a wrapper for embedded UIElements in text // flow content block collections // //--------------------------------------------------------------------------- using System.ComponentModel; // DesignerSerializationVisibility using System.Windows.Markup; // ContentProperty namespace System.Windows.Documents { ////// BlockUIContainer - a wrapper for embedded UIElements in text /// flow content block collections /// [ContentProperty("Child")] public class BlockUIContainer : Block { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Initializes a new instance of BlockUIContainer element. /// ////// The purpose of this element is to be a wrapper for UIElements /// when they are embedded into text flow - as items of /// BlockCollections. /// public BlockUIContainer() : base() { } ////// Initializes an BlockUIContainer specifying its child UIElement /// /// /// UIElement set as a child of this block item /// public BlockUIContainer(UIElement uiElement) : base() { if (uiElement == null) { throw new ArgumentNullException("uiElement"); } this.Child = uiElement; } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Properties ////// The content spanned by this TextElement. /// public UIElement Child { get { return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement; } set { TextContainer textContainer = this.TextContainer; textContainer.BeginChange(); try { TextPointer contentStart = this.ContentStart; UIElement child = Child; if (child != null) { textContainer.DeleteContentInternal(contentStart, this.ContentEnd); ContainerTextElementField.ClearValue(child); } if (value != null) { ContainerTextElementField.SetValue(value, this); contentStart.InsertUIElement(value); } } finally { textContainer.EndChange(); } } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: BlockUIContainer - a wrapper for embedded UIElements in text // flow content block collections // //--------------------------------------------------------------------------- using System.ComponentModel; // DesignerSerializationVisibility using System.Windows.Markup; // ContentProperty namespace System.Windows.Documents { ////// BlockUIContainer - a wrapper for embedded UIElements in text /// flow content block collections /// [ContentProperty("Child")] public class BlockUIContainer : Block { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Initializes a new instance of BlockUIContainer element. /// ////// The purpose of this element is to be a wrapper for UIElements /// when they are embedded into text flow - as items of /// BlockCollections. /// public BlockUIContainer() : base() { } ////// Initializes an BlockUIContainer specifying its child UIElement /// /// /// UIElement set as a child of this block item /// public BlockUIContainer(UIElement uiElement) : base() { if (uiElement == null) { throw new ArgumentNullException("uiElement"); } this.Child = uiElement; } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Properties ////// The content spanned by this TextElement. /// public UIElement Child { get { return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement; } set { TextContainer textContainer = this.TextContainer; textContainer.BeginChange(); try { TextPointer contentStart = this.ContentStart; UIElement child = Child; if (child != null) { textContainer.DeleteContentInternal(contentStart, this.ContentEnd); ContainerTextElementField.ClearValue(child); } if (value != null) { ContainerTextElementField.SetValue(value, this); contentStart.InsertUIElement(value); } } finally { textContainer.EndChange(); } } } #endregion } } // 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
- _LazyAsyncResult.cs
- ThreadAttributes.cs
- XmlSerializerFactory.cs
- MdiWindowListItemConverter.cs
- AstTree.cs
- MailHeaderInfo.cs
- GenericAuthenticationEventArgs.cs
- HttpApplicationFactory.cs
- ProfileService.cs
- DataBoundLiteralControl.cs
- MatrixConverter.cs
- WindowsTokenRoleProvider.cs
- TraceProvider.cs
- EntityProviderFactory.cs
- elementinformation.cs
- DbBuffer.cs
- Vector3dCollection.cs
- XmlILAnnotation.cs
- ObjectStateFormatter.cs
- ToolStripButton.cs
- PolyLineSegment.cs
- ClientOptions.cs
- IgnoreSection.cs
- ViewGenResults.cs
- NameValueSectionHandler.cs
- OutputCacheSettings.cs
- Run.cs
- CanExecuteRoutedEventArgs.cs
- EmbossBitmapEffect.cs
- SamlAuthenticationClaimResource.cs
- XsdDuration.cs
- WindowsGraphicsCacheManager.cs
- ValidatedControlConverter.cs
- ClientProxyGenerator.cs
- Expr.cs
- WinFormsComponentEditor.cs
- HttpProtocolReflector.cs
- XmlMtomReader.cs
- TableCellsCollectionEditor.cs
- HandlerBase.cs
- SatelliteContractVersionAttribute.cs
- DataListComponentEditor.cs
- EventPropertyMap.cs
- ChannelDispatcher.cs
- ObjectPersistData.cs
- SHA384CryptoServiceProvider.cs
- RemotingConfigParser.cs
- SoapSchemaImporter.cs
- AnnotationHighlightLayer.cs
- SmiRecordBuffer.cs
- Journal.cs
- HandleTable.cs
- CompatibleComparer.cs
- AddInIpcChannel.cs
- SqlNodeTypeOperators.cs
- StringDictionary.cs
- ProcessStartInfo.cs
- InstalledVoice.cs
- DataRow.cs
- RepeatBehaviorConverter.cs
- CharAnimationBase.cs
- MultiByteCodec.cs
- WinEventHandler.cs
- MetadataCache.cs
- TreeViewHitTestInfo.cs
- BevelBitmapEffect.cs
- MemoryPressure.cs
- ResourceIDHelper.cs
- CodeIterationStatement.cs
- DoubleAnimationClockResource.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- TouchFrameEventArgs.cs
- EventData.cs
- ObjectKeyFrameCollection.cs
- BindingGroup.cs
- ThreadAbortException.cs
- SoapDocumentServiceAttribute.cs
- QueueProcessor.cs
- Types.cs
- IIS7UserPrincipal.cs
- ExtractedStateEntry.cs
- LinqDataView.cs
- Invariant.cs
- GrammarBuilder.cs
- ProtectedProviderSettings.cs
- PrePostDescendentsWalker.cs
- ProfilePropertySettings.cs
- UntypedNullExpression.cs
- IdentityModelStringsVersion1.cs
- CommandLibraryHelper.cs
- Operator.cs
- SemaphoreSecurity.cs
- ClientRequest.cs
- Signature.cs
- ChildDocumentBlock.cs
- SystemIPv6InterfaceProperties.cs
- SelectionWordBreaker.cs
- AddressAccessDeniedException.cs
- _ContextAwareResult.cs
- DbQueryCommandTree.cs