public ImportPowerPointView(string _fileName) { HelperClass helperClass = new HelperClass(); InitializeComponent(); _documentMain = new ElearningDocument(); app = new pp.Application(); presentationFile = _fileName; presentation = app.Presentations.Open(_fileName, office.MsoTriState.msoTrue, office.MsoTriState.msoTrue, office.MsoTriState.msoFalse); if (System.IO.Path.GetExtension(_fileName) == ".ppt") { presentationFile = System.IO.Path.Combine((System.Windows.Application.Current as IAppGlobal).DocumentTempFolder, DateTime.Now.Ticks.ToString() + ".pptx"); presentation.SaveCopyAs(presentationFile, pp.PpSaveAsFileType.ppSaveAsOpenXMLPresentation, office.MsoTriState.msoCTrue); } Utils.tlw = 1024 / presentation.PageSetup.SlideWidth; Utils.tlh = 576 / presentation.PageSetup.SlideHeight; Utils.LstSlide = presentation.Slides; Opening oForm = new Opening(); oForm.ShowDialog(); this.DataContext = viewmodel; if (DataContext != null) { if ((DataContext as ImportPowerPointViewModel).CloseForm == null) { (DataContext as ImportPowerPointViewModel).CloseForm = new Action(Close); } } }
public Importing(ElearningDocument _documentMain, Presentation _presentation, string _presentationFile, bool _isBackground) { InitializeComponent(); this.presentation = _presentation; this.documentMain = _documentMain; this.presentationFile = _presentationFile; this.isBackground = _isBackground; }