public static void ShapeTextReplace(PowerPoint.TextRange textRange, Dictionary<string, string> replaces) { // var text = textRange.Text; foreach (var replace in replaces) { while(textRange.Text.Contains(replace.Key)) { textRange.Replace(replace.Key, replace.Value); } } }
public Paragraph(PowerPoint.Shape shape, Dictionary<string, object> parameters) { this.shape = shape; object tmp; if (parameters.TryGetValue("start", out tmp)) { this.start = (int)tmp; } else { this.start = -1; } if (parameters.TryGetValue("length", out tmp)) { this.length = (int)tmp; } else { this.length = -1; } }
public Shape(PowerPoint.Shape shape) { this.shape = shape; this.tags = new PowerPointTags(this.shape); }
public Presentation(PowerPoint.Presentation presentation) { this.presentation = presentation; this.tags = new PowerPointTags(this.presentation); this.properties = new DocumentProperty(this.presentation); }
public PowerPointTags(PowerPoint.Shape shape) { this.element = shape; }
public PowerPointTags(PowerPoint.Slide slide) { this.element = slide; }
public PowerPointTags(PowerPoint.Presentation presentation) { this.element = presentation; }
public DocumentProperty(PowerPoint.Presentation presentation) { this.element = presentation; }
/// <summary> /// Slide Show End Event handler /// </summary> /// <param name="command">PowerPoint.Presentation pres.</param> private void powerApplication_SlideShowEndEvent(PowerPoint.Presentation pres) { bool test = true; if (test) { MessageBox.Show("Called SlideshowEndEvent"); } else { // quit recording video // Not sure this will work. In fact, I'm almost sure it won't. _recThread.Start("q"); // dispose of the slide show event listeners. // Not sure this will work nested. _powerApplication.SlideShowBeginEvent -= powerApplication_SlideShowBeginEvent; _powerApplication.SlideShowEndEvent += powerApplication_SlideShowEndEvent; } }
/// <summary> /// Slide Show Begin Event handler /// </summary> /// <param name="command">PowerPoint.Presentation pres.</param> private void powerApplication_SlideShowBeginEvent(PowerPoint.SlideShowWindow ssw) { bool test = true; if (test) { MessageBox.Show("Called SlideshowBeginEvent"); } else { // Start the screencast recorder (depends on ffmpeg) // Could use its API which is libavformat, but I'm lazy right now /* pipe the screen as mpeg4 to a file or mux it * Not sure exactly how to 'quit' the process right now. Normally, you'd type 'q' on terminal. * ffmpeg -f dshow -i video="UScreenCapture" -r 30 -vcodec mpeg4 -q 12 -f %temp%/sermon.mp4 * This command below uses UDP for streaming which means packets could be lost or bandwidth could be gobbled up. * http://nerdlogger.com/2011/11/03/stream-your-windows-desktop-using-ffmpeg/ ffmpeg -f dshow -i video="UScreenCapture" -r 30 -vcodec mpeg4 -q 12 -f mpegts udp://aaa.bbb.ccc.ddd:6666?pkt_size=188?buffer_size=65535 */ _recThread = ExecuteCommandAsync("ffmpeg -f dshow -i video=\"UScreenCapture\" -r 30 -vcodec mpeg4 -q 12 -f %temp%/sermon.mp4"); } }
private void TextReplace(PowerPoint.TextRange textRange, Dictionary<string, string> replaces) { var text = textRange.Text; foreach (var replace in replaces) { if(text.Contains(replace.Key)) { textRange.Replace(replace.Key, replace.Value); } } }
public Slide(PowerPoint.Slide slide) { this.slide = slide; this.tags = new PowerPointTags(this.slide); }