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
- LambdaCompiler.cs
- TdsValueSetter.cs
- AssemblyResourceLoader.cs
- ExpressionBindings.cs
- TcpServerChannel.cs
- ApplicationException.cs
- BufferedWebEventProvider.cs
- ReadOnlyCollectionBuilder.cs
- QueryCacheEntry.cs
- Size3DConverter.cs
- PowerModeChangedEventArgs.cs
- NameValueCollection.cs
- HorizontalAlignConverter.cs
- Misc.cs
- Soap12FormatExtensions.cs
- FormatterServices.cs
- DataFormat.cs
- BindingExpression.cs
- Util.cs
- StreamGeometryContext.cs
- ReflectionPermission.cs
- TreeNodeStyleCollection.cs
- PrimitiveType.cs
- AutomationPattern.cs
- WebPageTraceListener.cs
- KeyGestureValueSerializer.cs
- UDPClient.cs
- HoistedLocals.cs
- XmlProcessingInstruction.cs
- Models.cs
- GridViewRow.cs
- HtmlUtf8RawTextWriter.cs
- ColorMatrix.cs
- TreeNodeStyleCollection.cs
- BitmapEffectDrawing.cs
- CssStyleCollection.cs
- TreeNode.cs
- TypeDelegator.cs
- WebConfigurationHost.cs
- XamlFigureLengthSerializer.cs
- PasswordTextContainer.cs
- CheckBoxBaseAdapter.cs
- LocationSectionRecord.cs
- RoleGroup.cs
- CodeVariableReferenceExpression.cs
- DataTableCollection.cs
- ThemeableAttribute.cs
- DirectoryInfo.cs
- EditorZone.cs
- RsaKeyIdentifierClause.cs
- WindowsSpinner.cs
- Propagator.Evaluator.cs
- EmulateRecognizeCompletedEventArgs.cs
- Executor.cs
- DataIdProcessor.cs
- PreProcessor.cs
- WebScriptServiceHost.cs
- RawTextInputReport.cs
- TrackingMemoryStream.cs
- HuffCodec.cs
- UniqueIdentifierService.cs
- DocumentXPathNavigator.cs
- SingleAnimation.cs
- PropertyMappingExceptionEventArgs.cs
- CodeGeneratorOptions.cs
- KeyNotFoundException.cs
- SecurityTokenTypes.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- MsmqTransportSecurity.cs
- PerformanceCounterCategory.cs
- QualifierSet.cs
- Int32Collection.cs
- FileSystemWatcher.cs
- X509Utils.cs
- TreeNodeSelectionProcessor.cs
- FunctionParameter.cs
- TypeUtil.cs
- FilterQueryOptionExpression.cs
- DynamicActivity.cs
- Dynamic.cs
- PageParser.cs
- ContainerVisual.cs
- ObjectViewEntityCollectionData.cs
- WindowHideOrCloseTracker.cs
- WindowsListViewGroup.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ValuePatternIdentifiers.cs
- smtppermission.cs
- IFlowDocumentViewer.cs
- IsolatedStorageFilePermission.cs
- CodeStatement.cs
- LineGeometry.cs
- MemberListBinding.cs
- ColumnResult.cs
- HtmlSelectionListAdapter.cs
- HtmlLink.cs
- WebBrowser.cs
- WebPartVerb.cs
- ToolStripTemplateNode.cs
- CssTextWriter.cs