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); } }
public void SaveLayout() { using (new WaitCursor()) { LayoutProperties = new LayoutProperties(); LayoutProperties.m_AudioPlayerInfo = new List <AudioPlayerInfo>(); //LayoutProperties.m_AudioPlayerInfo.AddRange(AudioPlayerInfo.Convert(myCanvas.Children.OfType<AudioPlaybackControl>().ToArray())); //Update(); LayoutProperties.WordDocument = txbSelectedWordFile.Text; m_Layout.Data1 = LayoutFileReader.GetBytes(SerializeToString(LayoutProperties)); m_Layout.Save(ProjectFileName); } }