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
- EditorAttribute.cs
- PageCodeDomTreeGenerator.cs
- objectresult_tresulttype.cs
- BamlTreeNode.cs
- Page.cs
- XmlSchemaComplexContentRestriction.cs
- BitmapSourceSafeMILHandle.cs
- FlowchartSizeFeature.cs
- SqlRowUpdatedEvent.cs
- FormCollection.cs
- TypedServiceOperationListItem.cs
- EventLogPermissionEntryCollection.cs
- CompoundFileStorageReference.cs
- MappedMetaModel.cs
- EntityDataSourceColumn.cs
- ShaperBuffers.cs
- SafeNativeMethodsMilCoreApi.cs
- TagMapCollection.cs
- EnvironmentPermission.cs
- httpserverutility.cs
- InternalRelationshipCollection.cs
- ApplicationGesture.cs
- ApplicationInfo.cs
- DataList.cs
- validationstate.cs
- HighContrastHelper.cs
- Image.cs
- HttpProcessUtility.cs
- ExpressionBuilder.cs
- SimplePropertyEntry.cs
- SamlConstants.cs
- HttpRequest.cs
- TouchesCapturedWithinProperty.cs
- Setter.cs
- WebEventTraceProvider.cs
- documentation.cs
- CqlLexer.cs
- SizeChangedEventArgs.cs
- FlowDocument.cs
- BindingContext.cs
- EventToken.cs
- PreloadedPackages.cs
- SqlException.cs
- XmlDigitalSignatureProcessor.cs
- DbDataSourceEnumerator.cs
- DataGridViewLinkColumn.cs
- MenuItem.cs
- WindowsTitleBar.cs
- ReaderWriterLockWrapper.cs
- ElementAction.cs
- DataGridViewTopRowAccessibleObject.cs
- Stopwatch.cs
- DataRowView.cs
- PropertyKey.cs
- SelectionProcessor.cs
- Timeline.cs
- HyperLink.cs
- AnnotationMap.cs
- SemanticValue.cs
- ConsumerConnectionPointCollection.cs
- HttpResponseHeader.cs
- SizeKeyFrameCollection.cs
- InteropBitmapSource.cs
- MemberRestriction.cs
- InvokeHandlers.cs
- TextElementEnumerator.cs
- ProgressBar.cs
- CounterCreationDataCollection.cs
- RemoteArgument.cs
- XmlSchemaInferenceException.cs
- RSAProtectedConfigurationProvider.cs
- DataGridViewImageColumn.cs
- ExpressionBindingCollection.cs
- ArgIterator.cs
- WindowsAltTab.cs
- HttpHandlerAction.cs
- ImportContext.cs
- DefaultBinder.cs
- CodeLinePragma.cs
- DeleteIndexBinder.cs
- processwaithandle.cs
- LocalValueEnumerator.cs
- OleDbCommandBuilder.cs
- ActivationArguments.cs
- StringPropertyBuilder.cs
- SiteMapProvider.cs
- FlowDocument.cs
- TypefaceMetricsCache.cs
- PeerHelpers.cs
- CqlWriter.cs
- ItemsControlAutomationPeer.cs
- XmlQueryCardinality.cs
- WebPartDisplayMode.cs
- Span.cs
- GlyphShapingProperties.cs
- SqlClientFactory.cs
- WebBrowserDesigner.cs
- TextTreeExtractElementUndoUnit.cs
- RepeatBehaviorConverter.cs
- SecurityTokenParametersEnumerable.cs