Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- PropertyDescriptorGridEntry.cs
- OleDbFactory.cs
- MetadataItem.cs
- SafeFileHandle.cs
- CommandDevice.cs
- UInt16.cs
- FileUpload.cs
- PersonalizableAttribute.cs
- StrokeCollection.cs
- PointConverter.cs
- WindowsPrincipal.cs
- HtmlControlDesigner.cs
- VersionedStreamOwner.cs
- DescendentsWalker.cs
- ToolStripContainerDesigner.cs
- AttachmentService.cs
- Knowncolors.cs
- InstanceDataCollectionCollection.cs
- BulletedList.cs
- SessionPageStatePersister.cs
- HttpCacheVaryByContentEncodings.cs
- TextRangeEdit.cs
- WmlTextBoxAdapter.cs
- ColumnReorderedEventArgs.cs
- DecoderExceptionFallback.cs
- SecurityTokenRequirement.cs
- ObjectViewQueryResultData.cs
- StoreItemCollection.cs
- DataTableClearEvent.cs
- HttpRequestWrapper.cs
- XmlElementAttribute.cs
- TransactionFilter.cs
- VirtualPath.cs
- SiteOfOriginPart.cs
- DockProviderWrapper.cs
- PeerTransportListenAddressValidatorAttribute.cs
- ConfigurationLocationCollection.cs
- PasswordBoxAutomationPeer.cs
- CharacterHit.cs
- ThousandthOfEmRealPoints.cs
- AttributeCollection.cs
- TemplateNameScope.cs
- MailWebEventProvider.cs
- DataGridViewCellFormattingEventArgs.cs
- DataGridViewHitTestInfo.cs
- Animatable.cs
- PeerTransportSecurityElement.cs
- StaticTextPointer.cs
- __Filters.cs
- ReceiveErrorHandling.cs
- ResourcePermissionBaseEntry.cs
- TableLayoutSettingsTypeConverter.cs
- ToolStripSplitStackLayout.cs
- SymbolEqualComparer.cs
- httpapplicationstate.cs
- Comparer.cs
- AsnEncodedData.cs
- NativeMethods.cs
- Membership.cs
- Compress.cs
- HttpListener.cs
- Errors.cs
- LogAppendAsyncResult.cs
- ListViewInsertEventArgs.cs
- InternalMappingException.cs
- LocalServiceSecuritySettings.cs
- NativeMethods.cs
- HttpServerVarsCollection.cs
- IdentityVerifier.cs
- BindableAttribute.cs
- PropertyCollection.cs
- SignatureGenerator.cs
- ScriptingProfileServiceSection.cs
- LazyLoadBehavior.cs
- CardSpacePolicyElement.cs
- Debugger.cs
- BufferedWebEventProvider.cs
- XmlSortKey.cs
- HtmlTextArea.cs
- ComponentEvent.cs
- newinstructionaction.cs
- UICuesEvent.cs
- WebServiceErrorEvent.cs
- input.cs
- TemplateNameScope.cs
- XmlTextReaderImpl.cs
- HtmlInputFile.cs
- AmbientProperties.cs
- TextDocumentView.cs
- DbSourceCommand.cs
- DataGridViewToolTip.cs
- XamlSerializer.cs
- KernelTypeValidation.cs
- ConvertBinder.cs
- PathSegmentCollection.cs
- CategoryValueConverter.cs
- TypeReference.cs
- Condition.cs
- WhitespaceSignificantCollectionAttribute.cs
- OleDbCommandBuilder.cs