private void MenuItemCreateLayout_Click(object sender, RoutedEventArgs e) { MyDeskLayout.ClearLayout(); Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); dlg.FileName = "My Scenario"; // Default file name dlg.DefaultExt = ".scomp"; // Default file extension dlg.Filter = "Scenario documents (.scomp)|*.scomp"; // Filter files by extension // Process save file dialog box results if (dlg.ShowDialog() == true) { ProjectFileName = dlg.FileName; m_Layout = new Layout(); m_Layout.Save(ProjectFileName); using (new WaitCursor()) { m_ComposerLayout.FrontSideLayout = new LayoutProperties(); m_ComposerLayout.RearSideLayout = new LayoutProperties(); m_ComposerLayout.FrontSideLayout.m_AudioPlayerInfo = new List <AudioPlayerInfo>(); WordDocument = ""; m_Layout.Data1 = LayoutFileReader.GetBytes(SerializeToString(m_ComposerLayout.FrontSideLayout)); m_Layout.Data2 = LayoutFileReader.GetBytes(SerializeToString(m_ComposerLayout.RearSideLayout)); m_Layout.Save(ProjectFileName); } m_IsNewProject = true; LoadProjectFileAsync(ProjectFileName); } }
private void MenuItemCloseProject_Click(object sender, RoutedEventArgs e) { MyDeskLayout.ClearLayout(); if (m_SampleDeskWindow != null) { m_SampleDeskWindow.MyDeskLayout.ClearLayout(); } string tmp = string.Concat(System.IO.Path.GetTempPath(), "\\", Guid.NewGuid().ToString(), ".docx"); ByteArrayToFile(tmp, Properties.Resources.scenario); ReadDocx(tmp); //LoadWordDocToView(tmp); IsProjectLoaded = false; }