/// <summary>
        /// Static constructor from a parent border constraint, a css, the number of lines and columns
        /// </summary>
        /// <param name="parent">parent constraint</param>
        /// <param name="css">css</param>
        /// <param name="countLines">number of lines</param>
        /// <param name="countColumns">number of columns</param>
        /// <returns>Border constraint</returns>
        public static BorderConstraint CreateBorderConstraint(BorderConstraint parent, CodeCSS css, uint countLines, uint countColumns)
        {
            uint borderWidth  = (uint)(css.Border.Left + css.Border.Right + css.Padding.Left + css.Padding.Right + css.Margin.Left + css.Margin.Right);
            uint borderHeight = (uint)(css.Border.Top + css.Border.Bottom + css.Padding.Top + css.Padding.Bottom + css.Margin.Top + css.Margin.Bottom);

            return(new BorderConstraint(parent, borderWidth, borderHeight, countLines, countColumns));
        }
Example #2
0
 /// <summary>
 /// Constructor from a previous parent constraint
 /// </summary>
 /// <param name="objectName">object name</param>
 /// <param name="parent">parent constraint</param>
 public ParentConstraint(string objectName, ParentConstraint parent)
 {
     this.precedingWidth   = parent.precedingWidth;
     this.precedingHeight  = parent.precedingHeight;
     this.constraintWidth  = parent.constraintWidth;
     this.constraintHeight = parent.constraintHeight;
     this.maximumWidth     = parent.maximumWidth;
     this.maximumHeight    = parent.maximumHeight;
     this.disposition      = parent.disposition;
     this.border           = parent.border;
     this.objectName       = objectName;
 }
Example #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="objectName">object name</param>
 /// <param name="precedingWidth">previous width</param>
 /// <param name="precedingHeight">previous height</param>
 /// <param name="constraintWidth">width constraint</param>
 /// <param name="constraintHeight">height constraint</param>
 /// <param name="maximumWidth">maximum width</param>
 /// <param name="maximumHeight">maximum height</param>
 /// <param name="disposition">disposition</param>
 /// <param name="border">border size and constraint</param>
 public ParentConstraint(string objectName, uint precedingWidth, uint precedingHeight, EnumConstraint constraintWidth,
                         EnumConstraint constraintHeight, uint maximumWidth, uint maximumHeight, Disposition disposition,
                         BorderConstraint border)
 {
     this.precedingWidth   = precedingWidth;
     this.precedingHeight  = precedingHeight;
     this.constraintWidth  = constraintWidth;
     this.constraintHeight = constraintHeight;
     this.maximumWidth     = maximumWidth;
     this.maximumHeight    = maximumHeight;
     this.disposition      = disposition;
     this.border           = border;
     this.objectName       = objectName;
 }
Example #4
0
        /// <summary>
        /// Generate design
        /// </summary>
        /// <returns>output</returns>
        public OutputHTML GenerateDesign()
        {
            Page           p  = new Page();
            MasterPage     mp = new MasterPage();
            HorizontalZone h  = new HorizontalZone();

            mp.HorizontalZones.Add(h);
            VerticalZone z = new VerticalZone();

            h.VerticalZones.Add(z);
            ParentConstraint parent = new ParentConstraint();

            parent.border = BorderConstraint.CreateBorderConstraint(this.CSS, (uint)this.CountLines, this.TotalCountColumns);
            return(Routines.GenerateProductionAny(GenerateProductionDIV(p, mp, parent)));
        }
 /// <summary>
 /// Constructor with a border constraint parent and a new horizontal border
 /// </summary>
 /// <param name="parent">parent</param>
 /// <param name="borderWidth">width size</param>
 /// <param name="borderHeight">height size</param>
 /// <param name="countLines">count of lines</param>
 public BorderConstraint(BorderConstraint parent, uint borderWidth, uint borderHeight, uint countLines)
 {
     this.parent                = parent;
     this.quotientWidth         = this.quotientHeight = 0;
     this.masterBorderWidth     = parent.masterBorderWidth;
     this.masterBorderHeight    = parent.masterBorderHeight;
     this.totalCountLines       = parent.totalCountLines;
     this.totalCountColumns     = parent.totalCountColumns;
     this.horizBorderWidth      = borderWidth;
     this.horizBorderHeight     = borderHeight;
     this.countLines            = countLines;
     this.vertBorderWidth       = 0;
     this.vertBorderHeight      = 0;
     this.countColumns          = 0;
     this.alreadyComputedHeight = false;
     this.alreadyComputedWidth  = false;
 }
 /// <summary>
 /// Border Constraint from a parent
 /// </summary>
 /// <param name="parent">parent</param>
 /// <returns>new border constraint</returns>
 public static BorderConstraint CreateBorderConstraint(BorderConstraint parent)
 {
     return(new BorderConstraint(parent));
 }