예제 #1
0
        /// <summary>
        /// A master page has a thumbnail visual
        /// </summary>
        /// <returns>html output</returns>
        public OutputHTML GenerateThumbnail()
        {
            Page page = new Page();

            if (this.ConstraintWidth == EnumConstraint.RELATIVE || this.ConstraintHeight == EnumConstraint.RELATIVE)
            {
                DesignPage config = new DesignPage();
                config.constraintWidth  = this.ConstraintWidth;
                config.constraintHeight = this.ConstraintHeight;
                config.width            = this.Width;
                config.height           = this.Height;
                CodeCSS cssThumbnail = new CodeCSS(this.CSS);
                cssThumbnail.Body.Add("zoom", "0.4");
                config.cssList          = ExtensionMethods.CloneThis(this.CSSList);
                config.cssOnFile        = false;
                config.cssFile          = "";
                config.events           = this.Events;
                config.javascriptPart   = this.JavaScript;
                config.javascriptOnFile = false;
                config.javascriptFile   = "";
                config.onload           = this.JavaScriptOnLoad;
                config.zones            = this.HorizontalZones;
                config.includeContainer = false;
                return(Routines.GenerateDesignPageTable(page, this, config));
            }
            else
            {
                // il faut décider si l'on utilise une table ou des div
                // s'il existe une colonne dont countLines > countLines de l'horizontal alors on utilise une table
                // sinon on peut utiliser des div
                bool cannotUseDiv = false;
                foreach (HorizontalZone hz in this.HorizontalZones)
                {
                    bool sup = false;
                    foreach (VerticalZone vz in hz.VerticalZones)
                    {
                        if (vz.CountLines < hz.CountLines)
                        {
                            sup = true;
                        }
                    }
                    if (sup)
                    {
                        cannotUseDiv = true;
                        break;
                    }
                }
                OutputHTML html;
                DesignPage config = new DesignPage();
                config.constraintWidth  = this.ConstraintWidth;
                config.constraintHeight = this.ConstraintHeight;
                config.width            = this.Width;
                config.height           = this.Height;
                CodeCSS cssThumbnail = new CodeCSS(this.CSS);
                cssThumbnail.Body.Add("zoom", "0.4");
                this.CSSList.AddCSS(cssThumbnail);
                config.cssList          = this.CSSList;
                config.cssOnFile        = false;
                config.cssFile          = "";
                config.events           = this.Events;
                config.javascriptPart   = this.JavaScript;
                config.javascriptOnFile = false;
                config.javascriptFile   = "";
                config.onload           = this.JavaScriptOnLoad;
                config.zones            = this.HorizontalZones;
                config.includeContainer = false;
                if (cannotUseDiv)
                {
                    html = Routines.GenerateDesignPageTable(page, this, config);
                }
                else
                {
                    html = Routines.GenerateDesignPageDIV(page, this, config);
                }
                return(html);
            }
        }