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
- EnumCodeDomSerializer.cs
- ClientTargetCollection.cs
- EntityDataSourceMemberPath.cs
- CommandEventArgs.cs
- EventKeyword.cs
- CodeMethodReturnStatement.cs
- SourceLineInfo.cs
- DigitalSignatureProvider.cs
- StickyNoteHelper.cs
- WebPartZoneBase.cs
- OleDbErrorCollection.cs
- PlatformCulture.cs
- ImageFormatConverter.cs
- StrongNameKeyPair.cs
- AssemblyHelper.cs
- RotateTransform.cs
- LOSFormatter.cs
- PromptEventArgs.cs
- FixedHighlight.cs
- HttpModule.cs
- ZipFileInfo.cs
- XmlReflectionMember.cs
- TextTreeInsertElementUndoUnit.cs
- FontFamily.cs
- DetailsViewRowCollection.cs
- TransactionChannelFaultConverter.cs
- DataRecordObjectView.cs
- DateTimeFormat.cs
- FormatException.cs
- CellIdBoolean.cs
- Button.cs
- CmsInterop.cs
- ObjectHandle.cs
- EditorAttributeInfo.cs
- InputChannel.cs
- DataGridHelper.cs
- SiteMapHierarchicalDataSourceView.cs
- MediaPlayerState.cs
- AppSettingsReader.cs
- CatchBlock.cs
- EntityDataSourceView.cs
- OperationContractAttribute.cs
- PassportPrincipal.cs
- IteratorFilter.cs
- CapiNative.cs
- ImplicitInputBrush.cs
- BufferAllocator.cs
- TypeLibConverter.cs
- WebPartCollection.cs
- HashStream.cs
- Timer.cs
- CngProvider.cs
- UInt64Storage.cs
- ParameterCollectionEditor.cs
- AuthenticationService.cs
- EdmSchemaAttribute.cs
- ListViewUpdatedEventArgs.cs
- Journal.cs
- DataGridViewColumnEventArgs.cs
- ReadOnlyPermissionSet.cs
- ToolStripDropDownMenu.cs
- DoubleCollection.cs
- BitmapEffectInputConnector.cs
- OverloadGroupAttribute.cs
- Misc.cs
- ColumnWidthChangingEvent.cs
- MultiSelector.cs
- StatusBar.cs
- DetailsView.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- SQLInt16.cs
- returneventsaver.cs
- TextTreeRootTextBlock.cs
- TextEndOfSegment.cs
- DataGridViewRowHeaderCell.cs
- GridViewDeletedEventArgs.cs
- EqualityComparer.cs
- QilPatternVisitor.cs
- PersonalizationProviderCollection.cs
- OTFRasterizer.cs
- COMException.cs
- NonParentingControl.cs
- ContextStaticAttribute.cs
- TreeNode.cs
- DecimalConstantAttribute.cs
- SqlTypeSystemProvider.cs
- PropertyEmitterBase.cs
- PolicyLevel.cs
- LambdaCompiler.Generated.cs
- Stylesheet.cs
- SelectingProviderEventArgs.cs
- HostingPreferredMapPath.cs
- NonBatchDirectoryCompiler.cs
- EntityDataSourceWrapperCollection.cs
- EntityDataSourceUtil.cs
- DesignerHost.cs
- UxThemeWrapper.cs
- SuppressIldasmAttribute.cs
- CmsUtils.cs
- SpecularMaterial.cs