Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Documents / BlockUIContainer.cs / 1 / 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
- FileRecordSequenceCompletedAsyncResult.cs
- ReadOnlyDataSource.cs
- X509Utils.cs
- TcpProcessProtocolHandler.cs
- DataGridViewRowsAddedEventArgs.cs
- RichTextBoxConstants.cs
- SignedXmlDebugLog.cs
- WindowsScrollBarBits.cs
- XmlSchemaIdentityConstraint.cs
- OutputCacheModule.cs
- LambdaCompiler.Unary.cs
- ParagraphVisual.cs
- SplashScreenNativeMethods.cs
- UnsafeNativeMethods.cs
- AdRotatorDesigner.cs
- ZipIOExtraFieldPaddingElement.cs
- HijriCalendar.cs
- FormViewCommandEventArgs.cs
- ListViewUpdatedEventArgs.cs
- NullableFloatAverageAggregationOperator.cs
- State.cs
- ActiveDesignSurfaceEvent.cs
- Soap12FormatExtensions.cs
- VisualStyleInformation.cs
- XpsTokenContext.cs
- QuaternionAnimationBase.cs
- ListViewCancelEventArgs.cs
- ConfigurationSettings.cs
- CodeExpressionCollection.cs
- DocumentPageView.cs
- SafePointer.cs
- CreateUserWizardStep.cs
- XPathScanner.cs
- SafeNativeMethods.cs
- RectangleF.cs
- WebBrowserNavigatingEventHandler.cs
- TransformPattern.cs
- TextParaClient.cs
- LocalValueEnumerator.cs
- ItemDragEvent.cs
- CategoryNameCollection.cs
- Attachment.cs
- DataGridViewLayoutData.cs
- DllHostInitializer.cs
- EntryWrittenEventArgs.cs
- ContextMenu.cs
- SQLByteStorage.cs
- CompilationUtil.cs
- CodeGroup.cs
- HealthMonitoringSection.cs
- GroupQuery.cs
- RestHandlerFactory.cs
- SelectedDatesCollection.cs
- ProxyManager.cs
- ContourSegment.cs
- DatagridviewDisplayedBandsData.cs
- RayHitTestParameters.cs
- MapPathBasedVirtualPathProvider.cs
- TextSearch.cs
- thaishape.cs
- InlineCollection.cs
- MouseDevice.cs
- CrossAppDomainChannel.cs
- TextSimpleMarkerProperties.cs
- EntryPointNotFoundException.cs
- TextWriterEngine.cs
- TextInfo.cs
- WindowsFormsLinkLabel.cs
- ComponentResourceKey.cs
- DatatypeImplementation.cs
- SystemNetworkInterface.cs
- SR.cs
- DataAdapter.cs
- SimpleType.cs
- XmlSchemaElement.cs
- UpdateTracker.cs
- MULTI_QI.cs
- ProjectionPath.cs
- MsmqChannelListenerBase.cs
- CodeExpressionStatement.cs
- DelegateArgumentReference.cs
- CompilerErrorCollection.cs
- LinqDataSourceHelper.cs
- followingquery.cs
- ResourceSetExpression.cs
- figurelength.cs
- ConnectionsZone.cs
- SessionStateModule.cs
- ToolStripManager.cs
- GridEntryCollection.cs
- EncoderFallback.cs
- ChtmlTextWriter.cs
- FixUp.cs
- AnonymousIdentificationSection.cs
- ObjectQuery.cs
- TextWriter.cs
- QueryMatcher.cs
- XmlSchemaSimpleContentExtension.cs
- NetSectionGroup.cs
- TextChangedEventArgs.cs