Code:
/ 4.0 / 4.0 / 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 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DefaultValue(true)] public bool HasTrailingParagraphBreakOnPaste { get { return !_ignoreTrailingParagraphBreakOnPaste; } set { _ignoreTrailingParagraphBreakOnPaste = !value; } } internal const string HasTrailingParagraphBreakOnPastePropertyName = "HasTrailingParagraphBreakOnPaste"; ///, because mechanisms like data binding, animation, styling /// are not supposed to work for it. /// /// 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 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DefaultValue(true)] public bool HasTrailingParagraphBreakOnPaste { get { return !_ignoreTrailingParagraphBreakOnPaste; } set { _ignoreTrailingParagraphBreakOnPaste = !value; } } internal const string HasTrailingParagraphBreakOnPastePropertyName = "HasTrailingParagraphBreakOnPaste"; ///, because mechanisms like data binding, animation, styling /// are not supposed to work for it. /// /// 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
- SqlRecordBuffer.cs
- Transform.cs
- PageTheme.cs
- ConfigXmlSignificantWhitespace.cs
- SimpleFieldTemplateFactory.cs
- ItemCollection.cs
- OdbcFactory.cs
- DesignTimeTemplateParser.cs
- PeerEndPoint.cs
- ObjectNotFoundException.cs
- CommonRemoteMemoryBlock.cs
- Propagator.Evaluator.cs
- ObjectSecurity.cs
- XPathNavigatorKeyComparer.cs
- DataPointer.cs
- DataServicePagingProviderWrapper.cs
- Claim.cs
- EmptyStringExpandableObjectConverter.cs
- _CacheStreams.cs
- JsonDeserializer.cs
- ImportRequest.cs
- GeometryGroup.cs
- OdbcParameterCollection.cs
- SpecialTypeDataContract.cs
- ColorPalette.cs
- TextStore.cs
- PanelDesigner.cs
- WpfXamlLoader.cs
- ManagementScope.cs
- TypeDescriptionProviderAttribute.cs
- OdbcErrorCollection.cs
- DataGridPagerStyle.cs
- TextBounds.cs
- WpfPayload.cs
- ProcessThreadCollection.cs
- safex509handles.cs
- LocalBuilder.cs
- LockedHandleGlyph.cs
- PtsContext.cs
- TemplateContentLoader.cs
- AnimationClock.cs
- securitycriticaldataClass.cs
- SubclassTypeValidator.cs
- ElementMarkupObject.cs
- VectorCollectionConverter.cs
- ExpressionVisitor.cs
- DesignBindingConverter.cs
- DataGridViewRowHeaderCell.cs
- ListenerUnsafeNativeMethods.cs
- SymbolResolver.cs
- SQLMoneyStorage.cs
- GraphicsContext.cs
- DesignerForm.cs
- RequestDescription.cs
- QilBinary.cs
- _HTTPDateParse.cs
- RewritingSimplifier.cs
- HttpWebRequestElement.cs
- Mappings.cs
- WindowsFont.cs
- SqlTransaction.cs
- NameValueConfigurationCollection.cs
- DataGridViewTopLeftHeaderCell.cs
- LifetimeServices.cs
- OAVariantLib.cs
- Atom10FormatterFactory.cs
- CollectionViewGroupRoot.cs
- figurelength.cs
- RsaElement.cs
- DesignerTransactionCloseEvent.cs
- ExtendedProperty.cs
- oledbconnectionstring.cs
- OleDbException.cs
- DesignerActionUIService.cs
- WindowsRichEdit.cs
- ExtentKey.cs
- EventLogHandle.cs
- SqlRecordBuffer.cs
- WindowsListView.cs
- TextContainer.cs
- Matrix3D.cs
- PersonalizableAttribute.cs
- LineProperties.cs
- SqlFactory.cs
- MenuItem.cs
- StringExpressionSet.cs
- ChannelServices.cs
- CustomAttribute.cs
- XPathSelfQuery.cs
- xmlfixedPageInfo.cs
- AnnotationHelper.cs
- FormsAuthenticationCredentials.cs
- EntityDesignerDataSourceView.cs
- ColorBlend.cs
- AuthenticationModuleElementCollection.cs
- _HeaderInfo.cs
- SpellerInterop.cs
- TypeSource.cs
- DataSourceHelper.cs
- NamespaceCollection.cs