public static void AddBehaviorSpecification(WordprocessingDocument document, BehaviorSpecification behavior) { _log.Info("Printing Behavior Properties: " + behavior.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Specification Behavior")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", aDef); ArtifactPrinter.AddBehaviorArtifactSpecification(document, behavior.Artifact); ArtifactPrinter.AddArtifactContent(document, behavior.Artifact, false, false, true); var basicProps = new[, ] { { "Is External:", behavior.IsExternal.ToString() }, { "Constructor:", behavior.ConstructorType } }; Utils.AddTable(document, basicProps); //"PlainTable3" CommonPrinter.BuildInvocationBindingsTable(document, behavior.Invocations, behavior.Artifact.Name); var bProps = behavior.Properties.ToArray(); if (bProps.Length > 0) { CommonPrinter.BuildPropertiesTable(document, behavior.Properties, false); } }
public static void AddPropertySetProperties(WordprocessingDocument document, PropertySet ps, bool book, bool isForAppendix = false) { ArtifactPrinter.AddArtifactContent(document, ps.Artifact, book, isForAppendix); _log.Info("Printing Property Set Properties: " + ps.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Property Set")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); CommonPrinter.BuildPropertiesTable(document, ps.Properties, book); if (!book) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); pbr.AppendChild(new Text("")); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); }
public static void PrintBehaviorGroup(WordprocessingDocument document, BehaviorGroup bg, bool book, bool isForAppendix = false) { ArtifactPrinter.AddArtifactContent(document, bg.Artifact, book, isForAppendix); _log.Info("Printing Behavior Group Properties: " + bg.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Behavior Group Details")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); foreach (var br in bg.Behaviors) { BehaviorPrinter.AddBehaviorReferenceProperties(document, br); } if (!book) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); pbr.AppendChild(new Text("")); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", pageBreak); }
public static void PrintBehavior(WordprocessingDocument document, Model.Core.Behavior behavior, bool book, bool isForAppendix = false) { ArtifactPrinter.AddArtifactContent(document, behavior.Artifact, book, isForAppendix); _log.Info("Printing Behavior Properties: " + behavior.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Behavior Details")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); var basicProps = new[, ] { { "Is External:", behavior.IsExternal.ToString() }, { "Constructor:", behavior.ConstructorType } }; Utils.AddTable(document, basicProps); //"PlainTable3" CommonPrinter.BuildInvocationsTable(document, behavior.Invocations); if (behavior.Properties.Any()) { CommonPrinter.BuildPropertiesTable(document, behavior.Properties, book); } }
public static void PrintTokenBase(WordprocessingDocument document, Base tokenBase, bool book, bool isForAppendix = false) { //print artifact stuff 1st ArtifactPrinter.AddArtifactContent(document, tokenBase.Artifact, book, isForAppendix); _log.Info("Printing Base Properties: " + tokenBase.TokenType); var body = document.MainDocumentPart.Document.Body; var baseProps = new[, ] { { "Token Name:", tokenBase.Name }, { "Token Type:", tokenBase.TokenType.ToString() }, { "Representation Type:", tokenBase.RepresentationType.ToString() }, { "Value Type:", tokenBase.ValueType.ToString() }, { "Token Unit:", tokenBase.TokenUnit.ToString() }, { "Symbol:", tokenBase.Symbol }, { "Owner:", tokenBase.Owner }, { "Quantity:", tokenBase.Quantity.ToString() }, { "Decimals:", tokenBase.Decimals.ToString() }, { "Constructor Name:", tokenBase.ConstructorName } }; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Base Details")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); Utils.AddTable(document, baseProps); if (tokenBase.TokenProperties.Count > 0) { var propDef = body.AppendChild(new Paragraph()); var propRun = propDef.AppendChild(new Run()); propRun.AppendChild(new Text("Properties:")); Utils.ApplyStyleToParagraph(document, "Heading3", "Heading3", propDef); var propsPara = body.AppendChild(new Paragraph()); var propsRun = propsPara.AppendChild(new Run()); propsRun.AppendChild( Utils.GetGenericPropertyTable(document, "Name", "Value", tokenBase.TokenProperties)); } if (!book) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); pbr.AppendChild(new Text("")); }
public static void AddBehaviorGroupSpecification(WordprocessingDocument document, BehaviorGroupSpecification bg) { ArtifactPrinter.AddArtifactContent(document, bg.Artifact, false, true); _log.Info("Printing Behavior Group Properties: " + bg.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var cDef = body.AppendChild(new Paragraph()); var dRun = cDef.AppendChild(new Run()); dRun.AppendChild(new Text("The behaviors belonging to this group are included in the Behaviors section of this specification.")); Utils.ApplyStyleToParagraph(document, "Quote", "Quote", cDef); }
public static void AddPropertySetSpecification(WordprocessingDocument document, PropertySetSpecification ps) { ArtifactPrinter.AddArtifactContent(document, ps.Artifact, false, true); _log.Info("Printing Property Set Specification Properties: " + ps.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Property Set Details")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", aDef); CommonPrinter.BuildPropertySpecificationTable(document, ps.Properties); }
public static void AddBehaviorReferenceProperties(WordprocessingDocument document, BehaviorReference behavior) { _log.Info("Printing Behavior Properties: " + behavior.Reference.Id); var body = document.MainDocumentPart.Document.Body; var name = Utils.GetNameForId(behavior.Reference.Id, ArtifactType.Behavior); var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Behavior Reference: " + name)); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", aDef); var rDef = body.AppendChild(new Paragraph()); var rRun = rDef.AppendChild(new Run()); rRun.AppendChild(new Text("Reference Notes: " + behavior.Reference.ReferenceNotes)); Utils.ApplyStyleToParagraph(document, "Quote", "Quote", rDef); var basicProps = new[, ] { { "Is External:", behavior.IsExternal.ToString() }, { "Constructor:", behavior.ConstructorType } }; Utils.AddTable(document, basicProps); //"PlainTable3" var appDef = body.AppendChild(new Paragraph()); var appRun = appDef.AppendChild(new Run()); appRun.AppendChild(new Text("Applies To")); Utils.ApplyStyleToParagraph(document, "Heading3", "Heading3", appDef); foreach (var a in behavior.AppliesTo) { ArtifactPrinter.GenerateArtifactSymbol(document, a); } CommonPrinter.BuildInvocationsTable(document, behavior.Invocations); CommonPrinter.BuildInfluenceBindings(document, behavior.InfluenceBindings, ArtifactType.Behavior); if (behavior.Properties.Any()) { CommonPrinter.BuildPropertiesTable(document, behavior.Properties, false); } }
public static void AddBaseSpecification(WordprocessingDocument document, Base tokenBase) { ArtifactPrinter.AddArtifactContent(document, tokenBase.Artifact, false, true); _log.Info("Printing Biz Base Properties: " + tokenBase.TokenType); var body = document.MainDocumentPart.Document.Body; var baseProps = new[, ] { { "Token Name:", tokenBase.Name }, { "Token Type:", tokenBase.TokenType.ToString() }, { "Representation Type:", tokenBase.RepresentationType.ToString() }, { "Value Type:", tokenBase.ValueType.ToString() }, { "Token Unit:", tokenBase.TokenUnit.ToString() }, { "Symbol:", tokenBase.Symbol }, { "Owner:", tokenBase.Owner }, { "Quantity:", tokenBase.Quantity.ToString() }, { "Decimals:", tokenBase.Decimals.ToString() }, { "Constructor Name:", tokenBase.ConstructorName } }; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Base Details")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); Utils.AddTable(document, baseProps); if (tokenBase.TokenProperties.Count <= 0) { return; } var propDef = body.AppendChild(new Paragraph()); var propRun = propDef.AppendChild(new Run()); propRun.AppendChild(new Text("Properties:")); Utils.ApplyStyleToParagraph(document, "Heading3", "Heading3", propDef); var propsPara = body.AppendChild(new Paragraph()); var propsRun = propsPara.AppendChild(new Run()); propsRun.AppendChild( Utils.GetGenericPropertyTable(document, "Name", "Value", tokenBase.TokenProperties)); }
public static void AddPropertySetSpecification(WordprocessingDocument document, PropertySetSpecification ps) { _log.Info("Printing Property Set Specification Properties: " + ps.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Specification Property Set")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", aDef); ArtifactPrinter.AddArtifactContent(document, ps.Artifact, false, true); var claPara = body.AppendChild(new Paragraph()); var claRun = claPara.AppendChild(new Run()); claRun.AppendChild(PresentRepresentationType(document, ps.RepresentationType)); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", claPara); if (ps.Properties.Count > 0) { CommonPrinter.BuildPropertySpecificationTable(document, ps.Properties); } }
public static void PrintSpecification(WordprocessingDocument document, TokenSpecification spec, bool isForAppendix = false) { var classification = ModelMap.GetClassification(spec); ArtifactPrinter.AddArtifactSpecification(document, spec.Artifact, classification, true); _log.Info("Printing Token Specification Properties: " + spec.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var beDef = body.AppendChild(new Paragraph()); var beRun = beDef.AppendChild(new Run()); beRun.AppendChild(new Text(spec.Artifact.Name + " is:")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", beDef); var behaviorList = spec.Behaviors.Select(b => b.Artifact.Name).ToList(); Utils.AddBulletList(document, behaviorList); if (spec.PropertySets.Count > 0) { var bgDef = body.AppendChild(new Paragraph()); var bgRun = bgDef.AppendChild(new Run()); bgRun.AppendChild(new Text("It includes the following Property Sets:")); Utils.ApplyStyleToParagraph(document, "Heading3", "Heading3", bgDef, JustificationValues.Center); var propSetList = spec.PropertySets.Select(b => b.Artifact.Name).ToList(); Utils.AddBulletList(document, propSetList); } if (spec.ChildTokens.Count > 0) { var cDef = body.AppendChild(new Paragraph()); var cRun = cDef.AppendChild(new Run()); cRun.AppendChild(new Text("As a Hybrid " + spec.Artifact.Name + " has the following Child Tokens:")); Utils.ApplyStyleToParagraph(document, "Heading3", "Heading3", cDef, JustificationValues.Center); foreach (var c in spec.ChildTokens) { ArtifactPrinter.AddChildArtifactSpecification(document, c); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", bbDef, JustificationValues.Center); } } var detailsDef = body.AppendChild(new Paragraph()); var detailsRun = detailsDef.AppendChild(new Run()); detailsRun.AppendChild(new Text(spec.Artifact.Name + " Details")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", detailsDef, JustificationValues.Center); BasePrinter.AddBaseSpecification(document, spec.TokenBase); var dDef = body.AppendChild(new Paragraph()); var dRun = dDef.AppendChild(new Run()); dRun.AppendChild(new Text("Behaviors")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", dDef); foreach (var b in spec.Behaviors) { BehaviorPrinter.AddBehaviorSpecification(document, b); } foreach (var bg in spec.BehaviorGroups) { BehaviorGroupPrinter.AddBehaviorGroupSpecification(document, bg); } foreach (var ps in spec.PropertySets) { PropertySetPrinter.AddPropertySetSpecification(document, ps); } foreach (var c in spec.ChildTokens) { PrintSpecification(document, c, false); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", bbDef, JustificationValues.Center); } if (isForAppendix) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); pbr.AppendChild(new Text("")); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", pageBreak); }
public static void PrintFormula(WordprocessingDocument document, TemplateFormula formula, bool book, bool isForAppendix = false) { ArtifactPrinter.AddArtifactContent(document, formula.Artifact, book, isForAppendix); _log.Info("Printing Template Formula Properties: " + formula.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Template Formula")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); var tDef = body.AppendChild(new Paragraph()); var tRun = tDef.AppendChild(new Run()); tRun.AppendChild(new Text("Template Type: " + formula.TemplateType)); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", tDef); var bDef = body.AppendChild(new Paragraph()); var bRun = bDef.AppendChild(new Run()); bRun.AppendChild(new Text("Base Token")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bDef, JustificationValues.Center); ArtifactPrinter.GenerateArtifactSymbol(document, formula.TokenBase.Base); var beDef = body.AppendChild(new Paragraph()); var beRun = beDef.AppendChild(new Run()); beRun.AppendChild(new Text("Behaviors")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", beDef, JustificationValues.Center); foreach (var b in formula.Behaviors) { ArtifactPrinter.GenerateArtifactSymbol(document, b.Behavior); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbDef, JustificationValues.Center); } var bgDef = body.AppendChild(new Paragraph()); var bgRun = bgDef.AppendChild(new Run()); bgRun.AppendChild(new Text("Behavior Groups")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bgDef, JustificationValues.Center); foreach (var b in formula.BehaviorGroups) { ArtifactPrinter.GenerateArtifactSymbol(document, b.BehaviorGroup); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbDef, JustificationValues.Center); } var pDef = body.AppendChild(new Paragraph()); var pRun = pDef.AppendChild(new Run()); pRun.AppendChild(new Text("Property Sets")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", pDef, JustificationValues.Center); foreach (var p in formula.PropertySets) { ArtifactPrinter.GenerateArtifactSymbol(document, p.PropertySet); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbDef, JustificationValues.Center); } var cDef = body.AppendChild(new Paragraph()); var cRun = cDef.AppendChild(new Run()); cRun.AppendChild(new Text("Child Tokens")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", cDef, JustificationValues.Center); foreach (var c in formula.ChildTokens) { PrintFormula(document, c, false); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbDef, JustificationValues.Center); } if (!book) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); pbr.AppendChild(new Text("")); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", pageBreak); }
public static void PrintDefinition(WordprocessingDocument document, TemplateDefinition definition, bool book, bool isForAppendix = false) { ArtifactPrinter.AddArtifactContent(document, definition.Artifact, book, isForAppendix); _log.Info("Printing Template Definition Properties: " + definition.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Template Definition")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", aDef, JustificationValues.Center); var tDef = body.AppendChild(new Paragraph()); var tRun = tDef.AppendChild(new Run()); var formulaName = Utils.GetNameForId(definition.FormulaReference.Id, ArtifactType.TemplateFormula); tRun.AppendChild(new Text("Template Formula Reference: " + formulaName)); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", tDef); ArtifactPrinter.AddArtifactReference(document, definition.FormulaReference); BasePrinter.AddBaseReference(document, definition.TokenBase); var beDef = body.AppendChild(new Paragraph()); var beRun = beDef.AppendChild(new Run()); beRun.AppendChild(new Text("Behaviors")); Utils.ApplyStyleToParagraph(document, "Heading1", "Heading1", beDef, JustificationValues.Center); foreach (var b in definition.Behaviors) { BehaviorPrinter.AddBehaviorReferenceProperties(document, b); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", bbDef, JustificationValues.Center); } var bgDef = body.AppendChild(new Paragraph()); var bgRun = bgDef.AppendChild(new Run()); bgRun.AppendChild(new Text("Behavior Groups")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bgDef, JustificationValues.Center); foreach (var bg in definition.BehaviorGroups) { ArtifactPrinter.AddArtifactReference(document, bg.Reference); foreach (var b in bg.BehaviorArtifacts) { var bbeDef = body.AppendChild(new Paragraph()); var bbeRun = bbeDef.AppendChild(new Run()); bbeRun.AppendChild(new Text("Behavior")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbeDef); BehaviorPrinter.AddBehaviorReferenceProperties(document, b); } } var pDef = body.AppendChild(new Paragraph()); var pRun = pDef.AppendChild(new Run()); pRun.AppendChild(new Text("Property Sets")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", pDef, JustificationValues.Center); foreach (var p in definition.PropertySets) { ArtifactPrinter.AddArtifactReference(document, p.Reference); var bbDef = body.AppendChild(new Paragraph()); var bbRun = bbDef.AppendChild(new Run()); bbRun.AppendChild(new Text("")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", bbDef, JustificationValues.Center); CommonPrinter.BuildPropertiesTable(document, p.Properties, false); } var cDef = body.AppendChild(new Paragraph()); var cRun = cDef.AppendChild(new Run()); cRun.AppendChild(new Text("Child Tokens")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", cDef, JustificationValues.Center); foreach (var c in definition.ChildTokens) { PrintDefinition(document, c, false); Utils.InsertSpacer(document); } if (!book) { return; } var pageBreak = body.AppendChild(new Paragraph()); var pbr = pageBreak.AppendChild(new Run()); pbr.AppendChild(new Text("")); if (pageBreak.ParagraphProperties == null) { pageBreak.ParagraphProperties = new ParagraphProperties(); } pageBreak.ParagraphProperties.PageBreakBefore = new PageBreakBefore(); Utils.ApplyStyleToParagraph(document, "Normal", "Normal", pageBreak); }