/// <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); }
/// <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); }
/// <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; }
/// <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> /// Generate design from a page and its objects /// </summary> /// <param name="refPage">page reference</param> /// <param name="objects">object list</param> /// <param name="parentConstraint">parent constraint</param> /// <returns>html output</returns> public OutputHTML GenerateDesign(Page refPage, List <MasterObject> objects, ParentConstraint parentConstraint) { if (this.IsMasterObject) { MasterObject selectedMo = Project.CurrentProject.MasterObjects.Find(mo => { return(mo.Name == this.MasterObjectName); }); if (selectedMo != null) { // calcul de la taille maximum de l'objet ParentConstraint newParent = new ParentConstraint(this.Name, parentConstraint); newParent.maximumWidth = selectedMo.Width; newParent.maximumHeight = selectedMo.Height; Routines.MoveConstraint(newParent, selectedMo.Width, selectedMo.Height, selectedMo.ConstraintWidth, selectedMo.ConstraintHeight); OutputHTML output = selectedMo.GenerateDesign(refPage, objects, newParent); return(output); } else { throw new KeyNotFoundException(String.Format(Localization.Strings.GetString("ExceptionMasterObjectNotExists"), this.MasterObjectName, this.Title)); } } else { OutputHTML html = new OutputHTML(); CodeCSS myCss = new CodeCSS(this.CSS); string myId = "obj" + Project.IncrementedTraceCounter.ToString(); ParentConstraint newInfos = Routines.ComputeObject(parentConstraint, this); Routines.SetObjectDisposition(newInfos, myCss, newInfos); 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("div", myId, myCss, this.Events, html.CSS, out tag); html.HTML.Append(tag); html.HTML.Append(this.GeneratedHTML); html.HTML.Append("</div>"); html.AppendCSS(this.CSSList.GetListWithoutPrincipal(this.Id)); html.JavaScript.Append(this.JavaScript.GeneratedCode); html.JavaScriptOnLoad.Append(this.JavaScriptOnLoad.GeneratedCode); return(html); } }
/// <summary> /// Generate page for actual website /// A page is the top-level of generation, so any argument is not needed /// </summary> /// <param name="refPage">page reference</param> /// <param name="masterRefPage">master page reference</param> /// <param name="objects">object list</param> /// <param name="parentConstraint">parent constraint</param> /// <returns>html output</returns> public OutputHTML GenerateProduction(Page refPage, MasterPage masterRefPage, List <MasterObject> objects, ParentConstraint parentConstraint) { throw new NotImplementedException(); }
/// <summary> /// Generate page for design /// A page is the top-level of generation, so any argument is not needed /// </summary> /// <param name="refPage">page reference</param> /// <param name="masterRefPage">master page reference</param> /// <param name="parentConstraint">parent constraint</param> /// <returns>html output</returns> public OutputHTML GenerateDesign(Page refPage, MasterPage masterRefPage, ParentConstraint parentConstraint) { throw new NotImplementedException(); }
/// <summary> /// Generate HTML TABLE tag on design of a page that you were supplied and its master page /// The master page object doesn't play with objects themselves, so this function is not implemented /// </summary> /// <param name="refPage">page reference</param> /// <param name="objects">master object list</param> /// <param name="parentConstraint">parent constraint</param> /// <returns>html output</returns> public OutputHTML GenerateDesignTable(Page refPage, List <MasterObject> objects, ParentConstraint parentConstraint) { throw new NotImplementedException(); }
/// <summary> /// Generate HTML DIV tag on design of a page that you were supplied and its master page /// The master page object doesn't use any other master page, so this function is not implemented /// </summary> /// <param name="refPage">page reference</param> /// <param name="refMasterObject">master object reference</param> /// <param name="parentConstraint">parent constraint</param> /// <returns>html output</returns> public OutputHTML GenerateDesignDIV(Page refPage, MasterObject refMasterObject, ParentConstraint parentConstraint) { throw new NotImplementedException(); }