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
- CompilationRelaxations.cs
- EdgeProfileValidation.cs
- SoapBinding.cs
- Point4D.cs
- Oid.cs
- SafeCoTaskMem.cs
- IssuedTokenParametersEndpointAddressElement.cs
- XmlDataCollection.cs
- DataGridCell.cs
- TextSelectionHighlightLayer.cs
- Dictionary.cs
- ConnectionStringSettings.cs
- SByte.cs
- SettingsBindableAttribute.cs
- AppendHelper.cs
- DesignerLoader.cs
- AnnotationHighlightLayer.cs
- ExtentJoinTreeNode.cs
- KeyedCollection.cs
- PreviewKeyDownEventArgs.cs
- TypeDelegator.cs
- DragDeltaEventArgs.cs
- SqlXmlStorage.cs
- SelectionRangeConverter.cs
- SocketInformation.cs
- MdiWindowListStrip.cs
- ShutDownListener.cs
- DataGridViewAccessibleObject.cs
- CorePropertiesFilter.cs
- UserNameSecurityToken.cs
- Point3DCollection.cs
- TextSegment.cs
- CheckBoxField.cs
- SelectionItemPattern.cs
- ContextMenuStripGroup.cs
- DecimalAnimation.cs
- WindowsSecurityToken.cs
- HebrewCalendar.cs
- SessionStateUtil.cs
- LinqDataSourceInsertEventArgs.cs
- SinglePageViewer.cs
- ReliableMessagingHelpers.cs
- Floater.cs
- XPathChildIterator.cs
- NullReferenceException.cs
- BaseInfoTable.cs
- TemplateEditingVerb.cs
- ObservableCollection.cs
- TabItemWrapperAutomationPeer.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- Point.cs
- WebResourceAttribute.cs
- System.Data_BID.cs
- ClientFormsIdentity.cs
- BaseUriWithWildcard.cs
- base64Transforms.cs
- PrivilegedConfigurationManager.cs
- BaseResourcesBuildProvider.cs
- RegexRunnerFactory.cs
- Reference.cs
- FunctionQuery.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- WebPartTransformerAttribute.cs
- SqlCacheDependencyDatabase.cs
- JobPageOrder.cs
- ModuleElement.cs
- DBSqlParserTableCollection.cs
- DesignerSerializationOptionsAttribute.cs
- GridViewCommandEventArgs.cs
- DateTimeUtil.cs
- ToolStripSeparator.cs
- LingerOption.cs
- Cloud.cs
- Visual3D.cs
- FieldToken.cs
- PassportPrincipal.cs
- StickyNoteHelper.cs
- Utils.cs
- OleDbError.cs
- DrawingContextWalker.cs
- ToolStripSystemRenderer.cs
- ThrowHelper.cs
- WorkflowDesignerMessageFilter.cs
- UserMapPath.cs
- ContentOperations.cs
- ItemCheckedEvent.cs
- InheritanceRules.cs
- XmlAttribute.cs
- Canvas.cs
- DBCSCodePageEncoding.cs
- PenLineCapValidation.cs
- InteropAutomationProvider.cs
- OutputCacheModule.cs
- DataGridViewColumnCollectionDialog.cs
- EntityDataSourceEntitySetNameItem.cs
- DefaultBindingPropertyAttribute.cs
- TracingConnectionListener.cs
- Errors.cs
- NetSectionGroup.cs
- SqlProviderManifest.cs