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 / 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 [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
- StylusPointPropertyId.cs
- WinEventHandler.cs
- TimersDescriptionAttribute.cs
- CustomServiceCredentials.cs
- GC.cs
- DispatchWrapper.cs
- WebPartExportVerb.cs
- StringFormat.cs
- ScaleTransform.cs
- NestedContainer.cs
- CheckBox.cs
- AndMessageFilter.cs
- SkipStoryboardToFill.cs
- X509CertificateCollection.cs
- ObjectItemLoadingSessionData.cs
- SqlDataSourceCommandParser.cs
- SerializationException.cs
- ConfigurationPropertyAttribute.cs
- PerformanceCounter.cs
- KnownTypesHelper.cs
- ButtonChrome.cs
- BinaryParser.cs
- ObjectSpanRewriter.cs
- LockedActivityGlyph.cs
- TextTreePropertyUndoUnit.cs
- GridViewColumnCollection.cs
- RemotingException.cs
- CompositeClientFormatter.cs
- IImplicitResourceProvider.cs
- XmlChildEnumerator.cs
- Deserializer.cs
- ClientSideProviderDescription.cs
- ListViewContainer.cs
- ProcessHost.cs
- WorkflowService.cs
- BoolExpr.cs
- NumberSubstitution.cs
- ColorAnimation.cs
- MachineKeyValidationConverter.cs
- FixedSOMSemanticBox.cs
- ResourcesGenerator.cs
- WsdlWriter.cs
- DoubleAnimationBase.cs
- FeatureSupport.cs
- BamlTreeMap.cs
- StrongNameUtility.cs
- KeyTimeConverter.cs
- CertificateReferenceElement.cs
- EdmMember.cs
- CapabilitiesRule.cs
- RenameRuleObjectDialog.Designer.cs
- CodeValidator.cs
- ForwardPositionQuery.cs
- ExpressionVisitor.cs
- StringArrayConverter.cs
- SystemTcpConnection.cs
- IgnoreFileBuildProvider.cs
- EmbeddedObject.cs
- FontFamily.cs
- WpfPayload.cs
- HyperLinkStyle.cs
- PersonalizationProviderCollection.cs
- WindowsRegion.cs
- PropertyExpression.cs
- AnonymousIdentificationModule.cs
- InheritanceContextHelper.cs
- Validator.cs
- SelectionPattern.cs
- SystemInfo.cs
- PersonalizationStateInfo.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- ToolboxCategoryItems.cs
- ServicePointManagerElement.cs
- TextRangeBase.cs
- HttpServerProtocol.cs
- FileAuthorizationModule.cs
- ToolboxItemLoader.cs
- EncodingDataItem.cs
- DescendantBaseQuery.cs
- sitestring.cs
- HttpAsyncResult.cs
- PriorityBinding.cs
- HierarchicalDataTemplate.cs
- counter.cs
- Permission.cs
- Object.cs
- UpdatePanelTriggerCollection.cs
- SaveRecipientRequest.cs
- IncrementalReadDecoders.cs
- WindowCollection.cs
- HitTestParameters.cs
- ExcludeFromCodeCoverageAttribute.cs
- ConfigurationManagerInternalFactory.cs
- X509AsymmetricSecurityKey.cs
- FixUp.cs
- EntityContainerAssociationSetEnd.cs
- MobileRedirect.cs
- DefaultValidator.cs
- EdmEntityTypeAttribute.cs
- SrgsItemList.cs