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
- CodeMemberEvent.cs
- PrivateFontCollection.cs
- TextDocumentView.cs
- JsonReader.cs
- DockPattern.cs
- RijndaelManaged.cs
- MarshalDirectiveException.cs
- ToolStripButton.cs
- EntityCommandExecutionException.cs
- ListViewItem.cs
- ListViewInsertedEventArgs.cs
- TransformedBitmap.cs
- _SpnDictionary.cs
- RuntimeEnvironment.cs
- ErrorProvider.cs
- DesignBindingPicker.cs
- DataListGeneralPage.cs
- XmlNode.cs
- DocumentGridPage.cs
- ListenerConnectionDemuxer.cs
- KeyNotFoundException.cs
- XmlElementAttribute.cs
- DeferredElementTreeState.cs
- HttpListenerTimeoutManager.cs
- UIPropertyMetadata.cs
- DataGridViewCellStyle.cs
- X509Extension.cs
- RotateTransform.cs
- QilNode.cs
- RegexEditorDialog.cs
- IODescriptionAttribute.cs
- XpsS0ValidatingLoader.cs
- FilterElement.cs
- dataobject.cs
- ArgumentNullException.cs
- BamlBinaryReader.cs
- TextContainer.cs
- TableProviderWrapper.cs
- DataGridColumnFloatingHeader.cs
- streamingZipPartStream.cs
- DataServiceStreamProviderWrapper.cs
- HierarchicalDataSourceControl.cs
- DataGridPagerStyle.cs
- FlowThrottle.cs
- DictionaryTraceRecord.cs
- PointIndependentAnimationStorage.cs
- IdentitySection.cs
- ParameterElement.cs
- ThrowHelper.cs
- DesignerView.xaml.cs
- XhtmlBasicObjectListAdapter.cs
- SupportedAddressingMode.cs
- AppDomainProtocolHandler.cs
- TableStyle.cs
- Int64AnimationBase.cs
- IntSumAggregationOperator.cs
- Int64AnimationUsingKeyFrames.cs
- ComponentConverter.cs
- SingleResultAttribute.cs
- BaseDataBoundControl.cs
- XmlCharacterData.cs
- FaultContext.cs
- Menu.cs
- WindowsEditBoxRange.cs
- SnapshotChangeTrackingStrategy.cs
- IconConverter.cs
- SqlTransaction.cs
- SafeLibraryHandle.cs
- ItemsPresenter.cs
- unsafenativemethodstextservices.cs
- AsnEncodedData.cs
- TypeSystemProvider.cs
- ImageCodecInfo.cs
- PartitionedDataSource.cs
- bindurihelper.cs
- CultureData.cs
- NotifyIcon.cs
- DataPagerField.cs
- DocumentEventArgs.cs
- ContractCodeDomInfo.cs
- InitializerFacet.cs
- nulltextcontainer.cs
- ConversionContext.cs
- SiteMembershipCondition.cs
- ToolStripItemRenderEventArgs.cs
- DesignerActionService.cs
- FocusTracker.cs
- RawUIStateInputReport.cs
- SBCSCodePageEncoding.cs
- DrawTreeNodeEventArgs.cs
- SoapHelper.cs
- IsolatedStorageSecurityState.cs
- _Semaphore.cs
- KeyFrames.cs
- HttpModuleCollection.cs
- PackageDigitalSignature.cs
- SortFieldComparer.cs
- EditingMode.cs
- XamlReader.cs
- CaseExpr.cs