Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / Section.cs / 1305600 / Section.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// Description: Section element.
//
//---------------------------------------------------------------------------
using System.ComponentModel;
using System.Windows.Markup; // ContentProperty
namespace System.Windows.Documents
{
///
/// Section element. It is an element which can contain a sequence of Block elements.
///
[ContentProperty("Blocks")]
public class Section : Block
{
//-------------------------------------------------------------------
//
// Constructors
//
//-------------------------------------------------------------------
#region Constructors
///
/// Initializes a new instance of a Section class.
///
public Section()
: base()
{
}
///
/// Initializes a new instance of a Section class specifying a first Block child for it.
///
///
/// Block element added to a Section as its first child.
///
public Section(Block block)
: base()
{
if (block == null)
{
throw new ArgumentNullException("block");
}
this.Blocks.Add(block);
}
#endregion Constructors
//--------------------------------------------------------------------
//
// Public Properties
//
//-------------------------------------------------------------------
#region Public Properties
///
/// The HasTrailingParagraphBreakOnPaste property specifies if paragraph break for the last paragraph
/// in serialized clipboard format should be included upon paste or not.
/// It is intended for use by clipboard serialization purpose:
/// only on wrapping root element.
/// Setting this property for regular elements in documents does not have any effect.
///
///
/// This is not a , because mechanisms like data binding, animation, styling
/// are not supposed to work for it.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[DefaultValue(true)]
public bool HasTrailingParagraphBreakOnPaste
{
get
{
return !_ignoreTrailingParagraphBreakOnPaste;
}
set
{
_ignoreTrailingParagraphBreakOnPaste = !value;
}
}
internal const string HasTrailingParagraphBreakOnPastePropertyName = "HasTrailingParagraphBreakOnPaste";
///
/// Collection of Blocks contained in this Section.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public BlockCollection Blocks
{
get
{
return new BlockCollection(this, /*isOwnerParent*/true);
}
}
#endregion Public Properties
//--------------------------------------------------------------------
//
// Internal Methods
//
//----------------------------------------------------------------------
#region Internal Methods
///
/// This method is used by TypeDescriptor to determine if this property should
/// be serialized.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeBlocks(XamlDesignerSerializationManager manager)
{
return manager != null && manager.XmlWriter == null;
}
#endregion
//-------------------------------------------------------------------
//
// Private Fields
//
//--------------------------------------------------------------------
#region Private Fields
private bool _ignoreTrailingParagraphBreakOnPaste;
#endregion Private Fields
}
}
// 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
- LoadGrammarCompletedEventArgs.cs
- SafeArrayTypeMismatchException.cs
- TypeInitializationException.cs
- SimpleRecyclingCache.cs
- shaperfactoryquerycachekey.cs
- OdbcParameterCollection.cs
- UserControlAutomationPeer.cs
- StrokeFIndices.cs
- OleDbException.cs
- TargetControlTypeCache.cs
- EditBehavior.cs
- AnimatedTypeHelpers.cs
- CommunicationException.cs
- DefaultValidator.cs
- NotFiniteNumberException.cs
- OleDbStruct.cs
- DefaultProfileManager.cs
- ToolStripItemDataObject.cs
- TabPageDesigner.cs
- Single.cs
- ListBase.cs
- ConcatQueryOperator.cs
- ComponentChangedEvent.cs
- ConstraintStruct.cs
- DynamicResourceExtension.cs
- BaseTreeIterator.cs
- PropertyEmitter.cs
- IPAddress.cs
- MethodBody.cs
- MD5.cs
- DataBoundLiteralControl.cs
- Section.cs
- TransformDescriptor.cs
- ProcessInputEventArgs.cs
- CodeDomLocalizationProvider.cs
- SymbolDocumentInfo.cs
- PolygonHotSpot.cs
- ComponentChangedEvent.cs
- WCFBuildProvider.cs
- BuildProviderAppliesToAttribute.cs
- DesigntimeLicenseContextSerializer.cs
- AmbientProperties.cs
- CacheMode.cs
- PartialTrustVisibleAssembliesSection.cs
- XmlRawWriterWrapper.cs
- MetadataUtilsSmi.cs
- PerfCounterSection.cs
- XsdDataContractImporter.cs
- StructuredType.cs
- XmlDigitalSignatureProcessor.cs
- SiteMapNodeItem.cs
- WebProxyScriptElement.cs
- ActivityDesignerResources.cs
- TraceListeners.cs
- ListBoxItemAutomationPeer.cs
- RubberbandSelector.cs
- DataBoundLiteralControl.cs
- FormParameter.cs
- ListControlDataBindingHandler.cs
- SelectionProviderWrapper.cs
- CachedPathData.cs
- SplitterEvent.cs
- ListGeneralPage.cs
- EventMappingSettings.cs
- DbModificationCommandTree.cs
- NavigationProperty.cs
- RemoteEndpointMessageProperty.cs
- PopupRoot.cs
- _DomainName.cs
- Permission.cs
- Authorization.cs
- CacheOutputQuery.cs
- PassportAuthentication.cs
- TreeViewImageIndexConverter.cs
- DataControlField.cs
- TemplatedAdorner.cs
- PatternMatchRules.cs
- XamlFigureLengthSerializer.cs
- TraceUtils.cs
- SmtpAuthenticationManager.cs
- ResourceBinder.cs
- CultureInfo.cs
- PolicyVersionConverter.cs
- ElapsedEventArgs.cs
- ImageAutomationPeer.cs
- ByteStreamGeometryContext.cs
- SchemaCollectionCompiler.cs
- CodeAttributeDeclarationCollection.cs
- IfAction.cs
- ListGeneralPage.cs
- DiscoveryClientBindingElement.cs
- XmlDataFileEditor.cs
- HandlerWithFactory.cs
- MILUtilities.cs
- RtfToken.cs
- FormView.cs
- MsmqChannelFactoryBase.cs
- SecurityProtocolCorrelationState.cs
- TreePrinter.cs
- ListBase.cs