ColumnPropertiesGroup.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / PtsHost / ColumnPropertiesGroup.cs / 1305600 / ColumnPropertiesGroup.cs

                            //---------------------------------------------------------------------------- 
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// File: ColumnPropertiesGroup.cs 
//
// Description: Column properties group. 
// 
// History:
//  05/05/2003 : [....] - created. 
//  07/18/2003 : [....] - converted to new Property Engine.
//
//---------------------------------------------------------------------------
 
using System;
using System.Diagnostics; 
using System.Windows; 
using System.Windows.Media;
using System.Windows.Documents; 
using MS.Internal.Text;

namespace MS.Internal.PtsHost
{ 
    // ---------------------------------------------------------------------
    // Column properties group. 
    // --------------------------------------------------------------------- 
    internal sealed class ColumnPropertiesGroup
    { 
        // ------------------------------------------------------------------
        // Constructor.
        // Remarks - the pageWidth parameter can be used to limit column
        // properties if the element is a FlowDocument. 
        // -----------------------------------------------------------------
        internal ColumnPropertiesGroup(DependencyObject o) 
        { 
            _columnWidth = (double)o.GetValue(FlowDocument.ColumnWidthProperty);
            _columnGap = (double)o.GetValue(FlowDocument.ColumnGapProperty); 
            _columnRuleWidth = (double)o.GetValue(FlowDocument.ColumnRuleWidthProperty);
            _columnRuleBrush = (Brush)o.GetValue(FlowDocument.ColumnRuleBrushProperty);
            _isColumnWidthFlexible = (bool)o.GetValue(FlowDocument.IsColumnWidthFlexibleProperty);
        } 

        // ------------------------------------------------------------------ 
        // Column width. 
        // ------------------------------------------------------------------
        internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } } 
        private double _columnWidth;

        // -----------------------------------------------------------------
        // Flexible column width. 
        // ------------------------------------------------------------------
        internal bool IsColumnWidthFlexible { get { return _isColumnWidthFlexible; } } 
        private bool _isColumnWidthFlexible; 

        // ----------------------------------------------------------------- 
        // Column space distribution.
        // -----------------------------------------------------------------
        internal ColumnSpaceDistribution ColumnSpaceDistribution { get { return ColumnSpaceDistribution.Between; } }
 
        // -----------------------------------------------------------------
        // Column gap. 
        // ------------------------------------------------------------------ 
        internal double ColumnGap
        { 
            get
            {
                Invariant.Assert(!double.IsNaN(_columnGap));
                return _columnGap; 
            }
        } 
        private double _columnGap; 

        // ----------------------------------------------------------------- 
        // Column rule brush.
        // ------------------------------------------------------------------
        internal Brush ColumnRuleBrush { get { return _columnRuleBrush; } }
        private Brush _columnRuleBrush; 

        // ------------------------------------------------------------------ 
        // Column rule width. 
        // -----------------------------------------------------------------
        internal double ColumnRuleWidth { get { return _columnRuleWidth; } } 
        private double _columnRuleWidth;

        // ------------------------------------------------------------------
        // Column width is set? 
        // -----------------------------------------------------------------
        internal bool ColumnWidthAuto { get { return DoubleUtil.IsNaN(_columnWidth); } } 
 
        // -----------------------------------------------------------------
        // Column gap is set? 
        // -----------------------------------------------------------------
        internal bool ColumnGapAuto
        {
            get 
            {
                return DoubleUtil.IsNaN(_columnGap); 
            } 
        }
    } 
}

// 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.
//
// File: ColumnPropertiesGroup.cs 
//
// Description: Column properties group. 
// 
// History:
//  05/05/2003 : [....] - created. 
//  07/18/2003 : [....] - converted to new Property Engine.
//
//---------------------------------------------------------------------------
 
using System;
using System.Diagnostics; 
using System.Windows; 
using System.Windows.Media;
using System.Windows.Documents; 
using MS.Internal.Text;

namespace MS.Internal.PtsHost
{ 
    // ---------------------------------------------------------------------
    // Column properties group. 
    // --------------------------------------------------------------------- 
    internal sealed class ColumnPropertiesGroup
    { 
        // ------------------------------------------------------------------
        // Constructor.
        // Remarks - the pageWidth parameter can be used to limit column
        // properties if the element is a FlowDocument. 
        // -----------------------------------------------------------------
        internal ColumnPropertiesGroup(DependencyObject o) 
        { 
            _columnWidth = (double)o.GetValue(FlowDocument.ColumnWidthProperty);
            _columnGap = (double)o.GetValue(FlowDocument.ColumnGapProperty); 
            _columnRuleWidth = (double)o.GetValue(FlowDocument.ColumnRuleWidthProperty);
            _columnRuleBrush = (Brush)o.GetValue(FlowDocument.ColumnRuleBrushProperty);
            _isColumnWidthFlexible = (bool)o.GetValue(FlowDocument.IsColumnWidthFlexibleProperty);
        } 

        // ------------------------------------------------------------------ 
        // Column width. 
        // ------------------------------------------------------------------
        internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } } 
        private double _columnWidth;

        // -----------------------------------------------------------------
        // Flexible column width. 
        // ------------------------------------------------------------------
        internal bool IsColumnWidthFlexible { get { return _isColumnWidthFlexible; } } 
        private bool _isColumnWidthFlexible; 

        // ----------------------------------------------------------------- 
        // Column space distribution.
        // -----------------------------------------------------------------
        internal ColumnSpaceDistribution ColumnSpaceDistribution { get { return ColumnSpaceDistribution.Between; } }
 
        // -----------------------------------------------------------------
        // Column gap. 
        // ------------------------------------------------------------------ 
        internal double ColumnGap
        { 
            get
            {
                Invariant.Assert(!double.IsNaN(_columnGap));
                return _columnGap; 
            }
        } 
        private double _columnGap; 

        // ----------------------------------------------------------------- 
        // Column rule brush.
        // ------------------------------------------------------------------
        internal Brush ColumnRuleBrush { get { return _columnRuleBrush; } }
        private Brush _columnRuleBrush; 

        // ------------------------------------------------------------------ 
        // Column rule width. 
        // -----------------------------------------------------------------
        internal double ColumnRuleWidth { get { return _columnRuleWidth; } } 
        private double _columnRuleWidth;

        // ------------------------------------------------------------------
        // Column width is set? 
        // -----------------------------------------------------------------
        internal bool ColumnWidthAuto { get { return DoubleUtil.IsNaN(_columnWidth); } } 
 
        // -----------------------------------------------------------------
        // Column gap is set? 
        // -----------------------------------------------------------------
        internal bool ColumnGapAuto
        {
            get 
            {
                return DoubleUtil.IsNaN(_columnGap); 
            } 
        }
    } 
}

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

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