Exemple #1
0
        /// <summary>
        /// Generate an HTML TABLE tag for actual website
        /// a given master page generates the page
        /// a page contains master objects related
        /// restricted objects in page are computed equally
        /// </summary>
        /// <param name="refPage">page reference</param>
        /// <param name="masterRefPage">master page reference</param>
        /// <param name="objects">master objects list</param>
        /// <param name="parentConstraint">parent constraint</param>
        /// <returns>html output</returns>
        public OutputHTML GenerateProductionTable(Page refPage, MasterPage masterRefPage, List <MasterObject> objects, ParentConstraint parentConstraint)
        {
            OutputHTML output = new OutputHTML();
            CodeCSS    myCss  = new CodeCSS(this.CSS);
            string     myId   = "horiz" + Project.IncrementedTraceCounter.ToString();

            // compute size
            ParentConstraint newInfos = Routines.ComputeHorizontalZone(parentConstraint, this);
            ConstraintSize   cs       = new ConstraintSize(newInfos.constraintWidth, newInfos.precedingWidth,
                                                           newInfos.maximumWidth, newInfos.constraintHeight,
                                                           newInfos.precedingHeight, newInfos.maximumHeight);

            myCss.Ids = "#" + myId;
            Routines.SetCSSPart(myCss, cs);

            string tag;

            this.Attributes.ToHTML("tr", myId, myCss, this.Events, output.CSS, out tag);
            output.HTML.Append(tag);

            foreach (VerticalZone vz in this.VerticalZones)
            {
                OutputHTML zone = vz.GenerateProductionTable(refPage, masterRefPage, objects, newInfos);
                output.HTML.Append(zone.HTML.ToString());
                output.CSS.Append(zone.CSS.ToString());
                output.JavaScript.Append(zone.JavaScript.ToString());
                output.JavaScriptOnLoad.Append(zone.JavaScriptOnLoad.ToString());
            }
            output.HTML.Append("</tr>");

            output.JavaScript.Append(this.JavaScript.GeneratedCode);
            output.JavaScriptOnLoad.Append(this.JavaScriptOnLoad.GeneratedCode);
            return(output);
        }
Exemple #2
0
        /// <summary>
        /// Generate an HTML DIV tag for design
        /// a given master page generates the page
        /// a page contains master objects related
        /// restricted objects in page are computed equally
        /// </summary>
        /// <param name="refPage">page reference</param>
        /// <param name="masterRefPage">master page reference</param>
        /// <param name="objects">master objects list</param>
        /// <param name="parentConstraint">parent constraint</param>
        /// <returns>html output</returns>
        public OutputHTML GenerateDesignDIV(Page refPage, MasterPage masterRefPage, List <MasterObject> objects, ParentConstraint parentConstraint)
        {
            OutputHTML output = new OutputHTML();
            CodeCSS    myCss  = new CodeCSS(this.CSS);

            if (this.VerticalZones.Count > 0)
            {
                string myId = "horiz" + Project.IncrementedTraceCounter.ToString();

                // compute size
                ParentConstraint newInfos = Routines.ComputeHorizontalZone(parentConstraint, this);
                ConstraintSize   cs       = new ConstraintSize(newInfos.constraintWidth, newInfos.precedingWidth,
                                                               newInfos.maximumWidth, newInfos.constraintHeight,
                                                               newInfos.precedingHeight, newInfos.maximumHeight);

                // set CSS part
                myCss.Ids = "#" + myId;
                Routines.SetCSSPart(myCss, cs);

                string tag;
                this.Attributes.ToHTML("div", myId, myCss, this.Events, output.CSS, out tag);
                output.HTML.Append(tag);


                List <VerticalZone> .Enumerator e = this.VerticalZones.GetEnumerator();
                VerticalZone lastZone             = null;
                if (e.MoveNext())
                {
                    do
                    {
                        if (lastZone != null)
                        {
                            OutputHTML zone = lastZone.GenerateDesignDIV(refPage, masterRefPage, objects, newInfos);
                            output.HTML.Append(zone.HTML.ToString());
                            output.CSS.Append(zone.CSS.ToString());
                            output.JavaScript.Append(zone.JavaScript.ToString());
                            output.JavaScriptOnLoad.Append(zone.JavaScriptOnLoad.ToString());
                        }
                        lastZone = e.Current;
                    } while (e.MoveNext());
                }
                if (lastZone != null)
                {
                    OutputHTML last = lastZone.GenerateDesignDIV(refPage, masterRefPage, objects, newInfos);
                    output.HTML.Append(last.HTML.ToString());
                    output.CSS.Append(last.CSS.ToString());
                    output.JavaScript.Append(last.JavaScript.ToString());
                    output.JavaScriptOnLoad.Append(last.JavaScriptOnLoad.ToString());
                }
                output.HTML.Append("</div>");

                output.JavaScript.Append(this.JavaScript.GeneratedCode);
                output.JavaScriptOnLoad.Append(this.JavaScriptOnLoad.GeneratedCode);
            }
            return(output);
        }