public void ImportQuizSlide(string docId, QuizSlide slide) { Logger.Log("Import Slide {0} of document {1}", slide.SlideIndex, docId); Dictionary<string, object> properties = SerializeSlide(docId, slide); StringBuilder builder = new StringBuilder(); BuildData(builder, "slide", properties); string slideResult = ExecuteImport(builder.ToString()); Logger.Log(slideResult); }
public static QuizSlide Parse(PPT.Slide pptSlide, string directory) { QuizSlide slide = new QuizSlide(); slide.SlideIndex = pptSlide.SlideNumber; slide.ImagePath = Path.Combine(directory, "Slide" + slide.SlideIndex + ".jpg"); StringBuilder builder = new StringBuilder(); foreach(PPT.Shape shape in pptSlide.Shapes) { if (shape.HasTextFrame == Microsoft.Office.Core.MsoTriState.msoTrue && shape.TextFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue) builder.AppendLine(shape.TextFrame.TextRange.Text); } slide.Text = builder.ToString(); return slide; }
private Dictionary<string, object> SerializeSlide(string docId, QuizSlide slide) { Dictionary<string, object> properties = new Dictionary<string, object>(); properties.Add("PresentationId", docId); properties.Add("ImageURL", slide.CanonicalName); properties.Add("TextContent", slide.Text.Replace("\"", "'")); properties.Add("SlideIndex", slide.SlideIndex.ToString()); return properties; }