Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Documents / Section.cs / 1 / 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.
//----------------------------------------------------------------------------
//
// 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
- DynamicControl.cs
- ConfigurationLockCollection.cs
- PinnedBufferMemoryStream.cs
- StateDesignerConnector.cs
- ValueTypeFieldReference.cs
- BooleanConverter.cs
- LinkTarget.cs
- SafeNativeMethodsCLR.cs
- ServiceParser.cs
- CompressEmulationStream.cs
- AsyncMethodInvoker.cs
- PointAnimation.cs
- Decoder.cs
- Int16Converter.cs
- PathFigureCollection.cs
- ToolTipService.cs
- FixedSOMTableCell.cs
- BamlWriter.cs
- GlobalizationAssembly.cs
- ObjectManager.cs
- EntitySqlQueryCacheKey.cs
- MethodAccessException.cs
- ApplicationCommands.cs
- DataGridPageChangedEventArgs.cs
- MediaContext.cs
- EmbossBitmapEffect.cs
- DataGridTablesFactory.cs
- StateBag.cs
- ForceCopyBuildProvider.cs
- XmlILTrace.cs
- GPPOINTF.cs
- DistributedTransactionPermission.cs
- AppSettingsSection.cs
- TypeElementCollection.cs
- WebPartZone.cs
- MatrixConverter.cs
- JpegBitmapDecoder.cs
- DispatcherOperation.cs
- ChildChangedEventArgs.cs
- PostBackOptions.cs
- SocketElement.cs
- XmlSchemaSimpleContentRestriction.cs
- TextElementEnumerator.cs
- DependencyPropertyConverter.cs
- XmlSignatureManifest.cs
- CharacterBufferReference.cs
- CornerRadius.cs
- SwitchLevelAttribute.cs
- AuthenticationModulesSection.cs
- StoryFragments.cs
- WorkerRequest.cs
- MethodImplAttribute.cs
- Drawing.cs
- TransportChannelListener.cs
- _HelperAsyncResults.cs
- TransformPattern.cs
- CompModHelpers.cs
- DictionaryEntry.cs
- ApplyImportsAction.cs
- Match.cs
- FormViewRow.cs
- ListItemCollection.cs
- SignerInfo.cs
- Typography.cs
- SiteIdentityPermission.cs
- StylusEventArgs.cs
- securitycriticaldataformultiplegetandset.cs
- JournalEntry.cs
- SiteIdentityPermission.cs
- UnsafeNativeMethods.cs
- ConnectionOrientedTransportManager.cs
- PackageFilter.cs
- Command.cs
- GridView.cs
- NameValuePermission.cs
- TypeInitializationException.cs
- ReliableSessionBindingElementImporter.cs
- DataViewSetting.cs
- UserControlParser.cs
- CodePageUtils.cs
- SqlDataSourceAdvancedOptionsForm.cs
- InertiaExpansionBehavior.cs
- DataTableNewRowEvent.cs
- XmlNodeComparer.cs
- ProfileBuildProvider.cs
- SaveRecipientRequest.cs
- ImageInfo.cs
- UnmanagedMemoryStreamWrapper.cs
- GreenMethods.cs
- SQLChars.cs
- DataSourceXmlSerializer.cs
- cookiecontainer.cs
- ServiceOperationListItemList.cs
- Events.cs
- DesignerAutoFormatStyle.cs
- StateMachine.cs
- DnsEndPoint.cs
- PlanCompilerUtil.cs
- BitSet.cs
- XmlException.cs