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
- SafeNativeMethods.cs
- InvocationExpression.cs
- NamespaceInfo.cs
- RichTextBox.cs
- BufferedOutputAsyncStream.cs
- HttpRequest.cs
- SharedStatics.cs
- ClrProviderManifest.cs
- List.cs
- HttpBufferlessInputStream.cs
- SuppressMergeCheckAttribute.cs
- UdpContractFilterBehavior.cs
- DrawingState.cs
- ZipPackage.cs
- MonitoringDescriptionAttribute.cs
- StrongNameMembershipCondition.cs
- CachingParameterInspector.cs
- HttpCachePolicyElement.cs
- WebEvents.cs
- ScalarRestriction.cs
- TextCompositionManager.cs
- CodeTypeReferenceCollection.cs
- Point3DConverter.cs
- CaseInsensitiveComparer.cs
- ExpressionEditorSheet.cs
- ProfileInfo.cs
- infer.cs
- LongValidator.cs
- PolicyException.cs
- DesignerVerbCollection.cs
- CodeDomSerializer.cs
- RemotingServices.cs
- XmlSignatureProperties.cs
- PageContentAsyncResult.cs
- RealProxy.cs
- IPPacketInformation.cs
- FileNotFoundException.cs
- Metadata.cs
- MethodExpression.cs
- WindowsFormsSectionHandler.cs
- __FastResourceComparer.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- XmlSerializerVersionAttribute.cs
- RemotingSurrogateSelector.cs
- JsonGlobals.cs
- SerializableAuthorizationContext.cs
- GeometryCombineModeValidation.cs
- NativeMethods.cs
- SQLDoubleStorage.cs
- CodePageUtils.cs
- SafeProcessHandle.cs
- HMACSHA384.cs
- WSSecurityJan2004.cs
- XmlCDATASection.cs
- ExclusiveHandle.cs
- HttpTransportBindingElement.cs
- FontClient.cs
- hresults.cs
- Encoding.cs
- OrthographicCamera.cs
- OracleConnectionString.cs
- AuthorizationSection.cs
- TrustLevel.cs
- ManagedIStream.cs
- TextBoxAutomationPeer.cs
- MultiBindingExpression.cs
- WebPageTraceListener.cs
- Constant.cs
- EntityClassGenerator.cs
- TimelineGroup.cs
- DesignTimeXamlWriter.cs
- ValidationHelper.cs
- EnumBuilder.cs
- RijndaelManagedTransform.cs
- ThreadStartException.cs
- XmlSchemaAnnotation.cs
- PatternMatcher.cs
- SettingsContext.cs
- Figure.cs
- TraceSwitch.cs
- MembershipAdapter.cs
- Stopwatch.cs
- DocumentPageView.cs
- UTF8Encoding.cs
- RegexReplacement.cs
- ApplicationCommands.cs
- RenderContext.cs
- PtsHost.cs
- HttpConfigurationSystem.cs
- BasicBrowserDialog.cs
- CryptoProvider.cs
- BoolExpression.cs
- BaseServiceProvider.cs
- HttpCachePolicyWrapper.cs
- TransformedBitmap.cs
- VBIdentifierTrimConverter.cs
- SQLDecimalStorage.cs
- FontDriver.cs
- ScriptBehaviorDescriptor.cs
- ConditionCollection.cs