/// <summary> /// Creates a simple text content and adds it to the provided content collection. /// </summary> /// <param name="doc"></param> /// <param name="content"></param> /// <param name="value">The value to write. May be null.</param> protected static void CreateAddSimpleText(IDocument doc, IContentCollection content, object value) { Paragraph p = ParagraphBuilder.CreateStandardTextParagraph(doc); p.TextContent.Add(new SimpleText(doc, Convert.ToString(value ?? string.Empty))); content.Add(p); }
public TrainingSession(IUserSettings settings, ITimer timer, ITrainer trainer, IMetronome metronome, ISequencer sequencer, IContentCollection content, IContentViewer viewer, IRandomNumberGenerator randomNumberGenerator) { Settings = settings; Trainer = trainer; Metronome = metronome; Sequencer = sequencer; Content = content; Viewer = viewer; Timer = timer; RNG = randomNumberGenerator; }
/// <summary> /// Convert a AODL IContentCollection into an ArrayList of IElement iText objects. /// </summary> /// <param name="iContentCollection">The i content collection.</param> /// <returns>An ArrayList of iText IElement objects.</returns> public static ArrayList GetMixedPdfContent(IContentCollection iContentCollection) { try { ArrayList mixedPdfContent = new ArrayList(); foreach (IContent content in iContentCollection) { if (content is AODL.Document.Content.Text.Paragraph) { if (((AODL.Document.Content.Text.Paragraph)content).MixedContent != null && ((AODL.Document.Content.Text.Paragraph)content).MixedContent.Count > 0) { mixedPdfContent.Add(ParagraphConverter.Convert( content as AODL.Document.Content.Text.Paragraph)); } else { mixedPdfContent.Add(iTextSharp.text.Chunk.NEWLINE); } } else if (content is AODL.Document.Content.Text.Header) { mixedPdfContent.Add(HeadingConverter.Convert( content as AODL.Document.Content.Text.Header)); } else if (content is AODL.Document.Content.Tables.Table) { TableConverter tc = new TableConverter(); mixedPdfContent.Add(tc.Convert( content as AODL.Document.Content.Tables.Table)); } else if (content is AODL.Document.Content.Draw.Frame) { DrawFrameConverter dfc = new DrawFrameConverter(); mixedPdfContent.Add(dfc.Convert( content as AODL.Document.Content.Draw.Frame)); } else if (content is AODL.Document.Content.Draw.Graphic) { ImageConverter ic = new ImageConverter(); mixedPdfContent.Add(ic.Convert( content as AODL.Document.Content.Draw.Graphic)); } } return(mixedPdfContent); } catch (Exception ex) { throw; } }
public TrainingSession(IUserSettings settings, ITimer timer, ITrainer trainer, ITaunter taunter, IMetronome metronome, ISequencer sequencer, IContentCollection content, IContentViewer viewer, IRandomNumberGenerator randomNumberGenerator) { _taunter = taunter; Settings = settings; Trainer = trainer; Taunter = taunter; Metronome = metronome; Sequencer = sequencer; Content = content; Viewer = viewer; Timer = timer; RNG = randomNumberGenerator; }
/// <summary> /// Appends the HTML. /// </summary> /// <param name="contentlist">The contentlist.</param> /// <param name="template">The template.</param> /// <returns>The filled template string</returns> private string AppendHtml(IContentCollection contentlist, string template) { try { HTMLContentBuilder htmlContentBuilder = new HTMLContentBuilder(); htmlContentBuilder.GraphicTargetFolder = this._imgFolder; string htmlBody = htmlContentBuilder.GetIContentCollectionAsHtml(this._document.Content); template += htmlBody; // foreach(IContent content in contentlist) // if(content is IHtml) // template += this.ReplaceControlNodes(((IHtml)content).GetHtml()); template += "</body>\n</html>"; template = this.SetMetaContent(template); return(template); } catch (Exception ex) { throw; } }
/// <summary> /// Initializes a new instance of the <see cref="TextPageFooter"/> class. /// </summary> protected TextPageHeaderFooterBase() { this._contentCollection = new IContentCollection(); }