private void exportTildaShape_Click(object sender, RibbonControlEventArgs e) { setUpFolders(); System.IO.File.WriteAllText(Settings.outputPath + Path.DirectorySeparatorChar + "settings.js", Settings.PresoSettingsToJS()); String js = ""; PowerPoint.PpSelectionType type = Globals.ThisAddIn.Application.ActiveWindow.Selection.Type; if (type == PowerPoint.PpSelectionType.ppSelectionNone || type == PowerPoint.PpSelectionType.ppSelectionText) { MessageBox.Show("You can only export slides right now via selection"); } else if (type == PowerPoint.PpSelectionType.ppSelectionSlides) { foreach (PowerPoint.Slide currentSlide in Globals.ThisAddIn.Application.ActiveWindow.Selection.SlideRange) { TildaSlide slide = new TildaSlide(currentSlide); js += "preso.slides.push(" + slide.exportSlide() + ");"; } export(js); } else if (type == PowerPoint.PpSelectionType.ppSelectionShapes) { /*PowerPoint.Slide currentSlide = Settings.ActiveSlide(); * TildaSlide slide = new TildaSlide(currentSlide); * slide.shapesRange = Globals.ThisAddIn.Application.ActiveWindow.Selection; * js += "preso.slides.push(" + slide.exportSlide() + ");";*/ MessageBox.Show("You can only export slides right now via selection"); } cleanUpFolders(); }
public void backgroundImageExported() { if (Directory.Exists(Settings.outputPath)) { Directory.Delete(Settings.outputPath, true); } Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); String actual = target.exportSlide(); bool bgcreated = false; foreach (string file in Directory.GetFiles(Settings.outputMediaFullPath)) { if (file.Contains("-bg.png")) { bgcreated = true; } } Assert.AreEqual(true, bgcreated); Assert.AreEqual(true, actual.Contains("preso.shapes.push(preso.paper.image('assets/")); Assert.AreEqual(true, actual.Contains(",0,0,2160,3800));preso.shapes[(preso.shapes.length-1)].toBack();")); Directory.Delete(Settings.outputPath, true); }
private void exportTildaSlide_Click(object sender, RibbonControlEventArgs e) { setUpFolders(); PowerPoint.Slide currentSlide = Settings.ActiveSlide(); TildaSlide slide = new TildaSlide(currentSlide); System.IO.File.WriteAllText(Settings.outputPath + Path.DirectorySeparatorChar + "settings.js", Settings.PresoSettingsToJS()); export("preso.slides.push(" + slide.exportSlide() + ");"); cleanUpFolders(); }
private void exportTildaPresentation_Click(object sender, RibbonControlEventArgs e) { PowerPoint.Presentation currentPreso = Settings.ActivePresentation(); setUpFolders(); System.IO.File.WriteAllText(Settings.outputPath + Path.DirectorySeparatorChar + "settings.js", Settings.PresoSettingsToJS()); String js = Settings.PresoSettingsToJS(); foreach(PowerPoint.Slide currentSlide in currentPreso.Slides) { TildaSlide slide = new TildaSlide(currentSlide); js += "preso.slides.push(" + slide.exportSlide() + ");"; } export(js); cleanUpFolders(); MessageBox.Show("Saved :)"); }
private void exportTildaPresentation_Click(object sender, RibbonControlEventArgs e) { PowerPoint.Presentation currentPreso = Settings.ActivePresentation(); setUpFolders(); System.IO.File.WriteAllText(Settings.outputPath + Path.DirectorySeparatorChar + "settings.js", Settings.PresoSettingsToJS()); String js = Settings.PresoSettingsToJS(); foreach (PowerPoint.Slide currentSlide in currentPreso.Slides) { TildaSlide slide = new TildaSlide(currentSlide); js += "preso.slides.push(" + slide.exportSlide() + ");"; } export(js); cleanUpFolders(); MessageBox.Show("Saved :)"); }
public void slideJSExportCode() { if (Directory.Exists(Settings.outputPath)) { Directory.Delete(Settings.outputPath, true); } Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); String actual = target.exportSlide(); Assert.AreEqual(true, actual.Contains("function(){")); Assert.AreEqual(true, actual[actual.Length - 1] == '}'); Directory.Delete(Settings.outputPath, true); }
public void backgroundImageExported() { if(Directory.Exists(Settings.outputPath)) Directory.Delete(Settings.outputPath, true); Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); String actual = target.exportSlide(); bool bgcreated = false; foreach(string file in Directory.GetFiles(Settings.outputMediaFullPath)){ if(file.Contains("-bg.png")) bgcreated = true; } Assert.AreEqual(true, bgcreated); Assert.AreEqual(true, actual.Contains("preso.shapes.push(preso.paper.image('assets/")); Assert.AreEqual(true, actual.Contains(",0,0,2160,3800));preso.shapes[(preso.shapes.length-1)].toBack();")); Directory.Delete(Settings.outputPath, true); }
public void shapesAreOrderedBasedOnZOrderAndVisibilityIsNotConsidered() { if (Directory.Exists(Settings.outputPath)) { Directory.Delete(Settings.outputPath, true); } Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); Shape tb = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb.TextFrame2.TextRange.Text = "Hello2"; Shape tb2 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb2.TextFrame2.TextRange.Text = "Hello1"; tb2.ZOrder(Office.MsoZOrderCmd.msoSendToBack); Shape tb3 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb3.TextFrame2.TextRange.Text = "Hello3"; tb3.ZOrder(Office.MsoZOrderCmd.msoSendToBack); tb3.Visible = Office.MsoTriState.msoFalse; String actual = target.exportSlide(); int first = actual.IndexOf("Hello1"); int second = actual.IndexOf("Hello2"); int third = actual.IndexOf("Hello3"); Assert.AreEqual(true, first < second); Assert.AreEqual(true, third < second); Directory.Delete(Settings.outputPath, true); }
public void shapesAreOrderedBasedOnZOrderAndVisibilityIsNotConsidered() { if(Directory.Exists(Settings.outputPath)) Directory.Delete(Settings.outputPath, true); Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); Shape tb = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb.TextFrame2.TextRange.Text = "Hello2"; Shape tb2 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb2.TextFrame2.TextRange.Text = "Hello1"; tb2.ZOrder(Office.MsoZOrderCmd.msoSendToBack); Shape tb3 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100); tb3.TextFrame2.TextRange.Text = "Hello3"; tb3.ZOrder(Office.MsoZOrderCmd.msoSendToBack); tb3.Visible = Office.MsoTriState.msoFalse; String actual = target.exportSlide(); int first = actual.IndexOf("Hello1"); int second = actual.IndexOf("Hello2"); int third = actual.IndexOf("Hello3"); Assert.AreEqual(true, first < second); Assert.AreEqual(true, third < second); Directory.Delete(Settings.outputPath, true); }
public void slideJSExportCode() { if(Directory.Exists(Settings.outputPath)) Directory.Delete(Settings.outputPath, true); Directory.CreateDirectory(Settings.outputPath); Directory.CreateDirectory(Settings.outputMediaFullPath); Slide slide = new TildaTests.Mocks.MockSlide(); TildaSlide target = new TildaSlide(slide); String actual = target.exportSlide(); Assert.AreEqual(true, actual.Contains("function(){")); Assert.AreEqual(true, actual[actual.Length-1]=='}'); Directory.Delete(Settings.outputPath, true); }
private void exportTildaShape_Click(object sender, RibbonControlEventArgs e) { setUpFolders(); System.IO.File.WriteAllText(Settings.outputPath + Path.DirectorySeparatorChar + "settings.js", Settings.PresoSettingsToJS()); String js = ""; PowerPoint.PpSelectionType type = Globals.ThisAddIn.Application.ActiveWindow.Selection.Type; if (type == PowerPoint.PpSelectionType.ppSelectionNone || type == PowerPoint.PpSelectionType.ppSelectionText) MessageBox.Show("You can only export slides right now via selection"); else if(type == PowerPoint.PpSelectionType.ppSelectionSlides) { foreach(PowerPoint.Slide currentSlide in Globals.ThisAddIn.Application.ActiveWindow.Selection.SlideRange) { TildaSlide slide = new TildaSlide(currentSlide); js += "preso.slides.push(" + slide.exportSlide() + ");"; } export(js); } else if(type == PowerPoint.PpSelectionType.ppSelectionShapes) { /*PowerPoint.Slide currentSlide = Settings.ActiveSlide(); TildaSlide slide = new TildaSlide(currentSlide); slide.shapesRange = Globals.ThisAddIn.Application.ActiveWindow.Selection; js += "preso.slides.push(" + slide.exportSlide() + ");";*/ MessageBox.Show("You can only export slides right now via selection"); } cleanUpFolders(); }