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
- DataGridViewLayoutData.cs
- GridViewRow.cs
- ManagementObjectSearcher.cs
- XhtmlBasicValidatorAdapter.cs
- ActiveDesignSurfaceEvent.cs
- XPathParser.cs
- safex509handles.cs
- ActivityValidationServices.cs
- ByValueEqualityComparer.cs
- TypeHelpers.cs
- TypeTypeConverter.cs
- AnimationException.cs
- TabPage.cs
- StylusPoint.cs
- EdmComplexTypeAttribute.cs
- SoapFormatter.cs
- TreeViewItemAutomationPeer.cs
- VirtualizingStackPanel.cs
- DesignerActionService.cs
- ScrollBar.cs
- WindowPattern.cs
- FlowLayoutSettings.cs
- BuildResultCache.cs
- ExceptionHandler.cs
- ReflectionPermission.cs
- ProgressBarAutomationPeer.cs
- TableItemPattern.cs
- OleDbParameterCollection.cs
- Primitive.cs
- RepeatBehavior.cs
- TypeLibConverter.cs
- NullableIntMinMaxAggregationOperator.cs
- ComAdminWrapper.cs
- AddInControllerImpl.cs
- SingleKeyFrameCollection.cs
- SafeNativeMethods.cs
- TemplateNameScope.cs
- InkCanvas.cs
- MetadataCollection.cs
- SimplePropertyEntry.cs
- TextServicesManager.cs
- Model3DCollection.cs
- HwndKeyboardInputProvider.cs
- RawMouseInputReport.cs
- COAUTHINFO.cs
- XmlComplianceUtil.cs
- FormsAuthenticationConfiguration.cs
- CryptoConfig.cs
- Rotation3DAnimation.cs
- WebBrowserContainer.cs
- DataGridViewRowsAddedEventArgs.cs
- SerialPort.cs
- RightsManagementEncryptionTransform.cs
- CriticalFinalizerObject.cs
- KeyFrames.cs
- AspCompat.cs
- _ShellExpression.cs
- ForAllOperator.cs
- XmlExceptionHelper.cs
- RoutedEventValueSerializer.cs
- SurrogateDataContract.cs
- TemplateBindingExtension.cs
- SafeNativeMethods.cs
- DataGridViewElement.cs
- TimeSpan.cs
- MemoryRecordBuffer.cs
- TextDpi.cs
- StorageScalarPropertyMapping.cs
- PeerApplication.cs
- ProcessManager.cs
- OrderByExpression.cs
- PerspectiveCamera.cs
- QueueProcessor.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CSharpCodeProvider.cs
- StickyNote.cs
- SRGSCompiler.cs
- ToolStripDropDownClosedEventArgs.cs
- UnconditionalPolicy.cs
- FontUnit.cs
- UserControl.cs
- EnumBuilder.cs
- webbrowsersite.cs
- MarkerProperties.cs
- ScrollViewer.cs
- PageHandlerFactory.cs
- RangeBase.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- AtlasWeb.Designer.cs
- QueryOutputWriter.cs
- ComponentGlyph.cs
- filewebresponse.cs
- SslStream.cs
- System.Data_BID.cs
- MobilePage.cs
- MsmqIntegrationProcessProtocolHandler.cs
- SystemResources.cs
- WindowAutomationPeer.cs
- Keyboard.cs
- TagPrefixAttribute.cs