private static void WriteUnitTestStepObjectCreation(UnitTestStepObjectCreationViewModel step, DocX doc) { Paragraph p; p = doc.InsertParagraph(); p.StyleName = "Heading2"; p.InsertText(string.Format("Step {0}: {1}", step.ParentIndex + 1, step.DisplayName)); p = doc.InsertParagraph(); p.StyleName = "Normal"; p.InsertText("Object class: " + step.ObjectClassName); p.AppendLine("Object name: " + step.Name); p.AppendLine("Object ID: " + step.ObjectId); p = doc.InsertParagraph(); p.StyleName = "Heading3"; p.InsertText(string.Format("Attribute modifications")); Table t = doc.InsertTable(step.AttributeChanges.Count + 1, 3); t.Alignment = Alignment.left; t.Design = TableDesign.LightListAccent1; t.Rows[0].Cells[0].Paragraphs.First().Append("Attribute"); t.Rows[0].Cells[1].Paragraphs.First().Append("Modification type"); t.Rows[0].Cells[2].Paragraphs.First().Append("Value"); for (int i = 0; i < step.AttributeChanges.Count; i++) { t.Rows[i + 1].Cells[0].Paragraphs.First().Append(step.AttributeChanges[i].Name); t.Rows[i + 1].Cells[1].Paragraphs.First().Append(step.AttributeChanges[i].ModificationType.ToString()); t.Rows[i + 1].Cells[2].Paragraphs.First().Append(step.AttributeChanges[i].ValueChangesString); } }
private BitmapSource GetIcon(UnitTestStepObjectCreationViewModel item) { return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/NewObject.png", UriKind.Absolute))); }