FlowLayoutSettings.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / FlowLayoutSettings.cs / 1 / FlowLayoutSettings.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
    using System; 
    using System.ComponentModel;
    using System.Diagnostics; 
    using System.Drawing;
    using System.Windows.Forms.Layout;

    ///  
    [DefaultProperty("FlowDirection")]
    public class FlowLayoutSettings : LayoutSettings { 
 
        internal FlowLayoutSettings(IArrangedElement owner) : base(owner) {}
 
        /// 
        public override LayoutEngine LayoutEngine {
            get { return FlowLayout.Instance; }
        } 

        ///  
        [SRDescription(SR.FlowPanelFlowDirectionDescr)] 
        [DefaultValue(FlowDirection.LeftToRight)]
        [SRCategory(SR.CatLayout)] 
        public FlowDirection FlowDirection {
            get { return FlowLayout.GetFlowDirection(Owner); }
            set {
                FlowLayout.SetFlowDirection(Owner, value); 
                Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it");
            } 
        } 

        ///  
        [SRDescription(SR.FlowPanelWrapContentsDescr)]
        [DefaultValue(true)]
        [SRCategory(SR.CatLayout)]
        public bool WrapContents { 
            get { return FlowLayout.GetWrapContents(Owner); }
            set { 
                FlowLayout.SetWrapContents(Owner, value); 
                Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
            } 
        }

        public void SetFlowBreak(object child, bool value) {
            IArrangedElement element = FlowLayout.Instance.CastToArrangedElement(child); 
            if (GetFlowBreak(child) != value) {
                CommonProperties.SetFlowBreak(element, value); 
            } 
        }
 
        public bool GetFlowBreak(object child) {
            IArrangedElement element = FlowLayout.Instance.CastToArrangedElement(child);
            return CommonProperties.GetFlowBreak(element);
        } 

 
    } 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
    using System; 
    using System.ComponentModel;
    using System.Diagnostics; 
    using System.Drawing;
    using System.Windows.Forms.Layout;

    ///  
    [DefaultProperty("FlowDirection")]
    public class FlowLayoutSettings : LayoutSettings { 
 
        internal FlowLayoutSettings(IArrangedElement owner) : base(owner) {}
 
        /// 
        public override LayoutEngine LayoutEngine {
            get { return FlowLayout.Instance; }
        } 

        ///  
        [SRDescription(SR.FlowPanelFlowDirectionDescr)] 
        [DefaultValue(FlowDirection.LeftToRight)]
        [SRCategory(SR.CatLayout)] 
        public FlowDirection FlowDirection {
            get { return FlowLayout.GetFlowDirection(Owner); }
            set {
                FlowLayout.SetFlowDirection(Owner, value); 
                Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it");
            } 
        } 

        ///  
        [SRDescription(SR.FlowPanelWrapContentsDescr)]
        [DefaultValue(true)]
        [SRCategory(SR.CatLayout)]
        public bool WrapContents { 
            get { return FlowLayout.GetWrapContents(Owner); }
            set { 
                FlowLayout.SetWrapContents(Owner, value); 
                Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
            } 
        }

        public void SetFlowBreak(object child, bool value) {
            IArrangedElement element = FlowLayout.Instance.CastToArrangedElement(child); 
            if (GetFlowBreak(child) != value) {
                CommonProperties.SetFlowBreak(element, value); 
            } 
        }
 
        public bool GetFlowBreak(object child) {
            IArrangedElement element = FlowLayout.Instance.CastToArrangedElement(child);
            return CommonProperties.GetFlowBreak(element);
        } 

 
    } 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK