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
- SqlVisitor.cs
- MemoryRecordBuffer.cs
- RenderData.cs
- RoutedUICommand.cs
- NonVisualControlAttribute.cs
- SocketInformation.cs
- SqlProviderServices.cs
- IUnknownConstantAttribute.cs
- ChannelBase.cs
- EncodingDataItem.cs
- DataBindingCollectionConverter.cs
- DataKeyArray.cs
- SqlErrorCollection.cs
- NativeMethods.cs
- PeerTransportBindingElement.cs
- EncryptedType.cs
- SBCSCodePageEncoding.cs
- ReverseInheritProperty.cs
- BaseHashHelper.cs
- GridViewRowCollection.cs
- CodeStatementCollection.cs
- CommandPlan.cs
- ContactManager.cs
- CustomCredentialPolicy.cs
- DesignerOptionService.cs
- Rect.cs
- WorkflowValidationFailedException.cs
- xdrvalidator.cs
- XmlSchemaElement.cs
- FileVersion.cs
- WinEventTracker.cs
- GrammarBuilderPhrase.cs
- MemoryMappedViewStream.cs
- EndpointNameMessageFilter.cs
- GeometryConverter.cs
- RecordManager.cs
- GetLedgerRequest.cs
- ReadonlyMessageFilter.cs
- InheritedPropertyChangedEventArgs.cs
- WindowManager.cs
- ConfigXmlComment.cs
- CompoundFileIOPermission.cs
- SecurityElement.cs
- ManagementException.cs
- SingleConverter.cs
- LambdaExpression.cs
- XmlSchemaFacet.cs
- WindowsFormsHostAutomationPeer.cs
- ObjectConverter.cs
- SqlRemoveConstantOrderBy.cs
- BrushValueSerializer.cs
- WindowsFormsHostAutomationPeer.cs
- Package.cs
- InputDevice.cs
- VectorCollection.cs
- PriorityRange.cs
- MaterializeFromAtom.cs
- ExceptionUtil.cs
- CellIdBoolean.cs
- AssociationSet.cs
- Transform.cs
- DropShadowEffect.cs
- SpeakInfo.cs
- HelpInfo.cs
- Logging.cs
- ObjectDataSourceView.cs
- WindowsStatusBar.cs
- InternalControlCollection.cs
- BrowserCapabilitiesFactoryBase.cs
- Path.cs
- CodeAccessSecurityEngine.cs
- PriorityRange.cs
- MessageQueuePermission.cs
- CurrencyManager.cs
- ParserStreamGeometryContext.cs
- GlyphRunDrawing.cs
- TypeDelegator.cs
- CustomAttribute.cs
- AttributeCollection.cs
- FormViewPageEventArgs.cs
- GridViewColumnCollectionChangedEventArgs.cs
- MimeReturn.cs
- UnsafeNativeMethodsMilCoreApi.cs
- PublisherMembershipCondition.cs
- NetDataContractSerializer.cs
- BaseTreeIterator.cs
- SortableBindingList.cs
- XPathMultyIterator.cs
- XmlSerializerNamespaces.cs
- Debug.cs
- StandardCommands.cs
- Parameter.cs
- OleDbErrorCollection.cs
- ExpressionPrinter.cs
- ResourceWriter.cs
- LinkLabelLinkClickedEvent.cs
- SystemIPGlobalStatistics.cs
- HttpRuntimeSection.cs
- Popup.cs
- RichTextBoxAutomationPeer.cs