static void SavePlaylistToFile(StartingWindowForm t, List <FirePlayList> List) { XmlDocument doc = new XmlDocument(); XmlNode root = doc.CreateElement("PlayList"); FirePlayList l = new FirePlayList("Temp"); l.AddMultipleLists(List); if (t.StartButtonControlDown) { l.DefaultTheList(); } foreach (FirePlaySong s in l.Songs) { try { XmlNode item = doc.CreateElement("PlayItem"); for (int i = 0; i < FirePlaySong.Elements.Length; i++) { XmlNode c = doc.CreateElement(FirePlaySong.Elements[i]); c.InnerText = s.SongElementByIndex(i); item.AppendChild(c); } root.AppendChild(item); } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK); t.Close(); } } doc.AppendChild(root); using (System.IO.StreamWriter tw = new StreamWriter(File.Open(t.save_textBox.Text, FileMode.OpenOrCreate), Encoding.Default)) doc.Save(tw); }
private void default_button_Click(object sender, EventArgs e) { FirePlayList l = EPClass.ExportList.Clone(); l.DefaultTheList(); StartingWindowForm.SavePlaylistToFileAsPlainTextXML(Location, l); l = null; //SaveList(EPClass.ExportListDefaulted); this.Close(); }
//////////////////////////////////////////////////////////////////////////////////// public StartingWindowForm() { InitializeComponent(); this.KeyPreview = true; this.KeyDown += (sender, args) => { if (args.KeyCode == Keys.Enter && file_list_box.Items.Count > 0 && save_textBox.Text != "") { start_button_Click(sender, args); } }; SweeperSettings.main_window = this; this.AllowDrop = true; //Allows for drag-drop functionality this.DragEnter += new DragEventHandler(Form1_DragEnter); //Drag-drop this.DragDrop += new DragEventHandler(Form1_DragDrop); //Drag-drop function assigned Setup(); this_window = this; StartingWindowForm.Sweeper_Settings = new SweeperSettings(); Sweeper_Settings.SetupOnStartup(); //Settings for the sweepers if (ExtraNoveListe.Program.args != null) { string[] new_files = ExtraNoveListe.Program.args; //foreach (string h in new_files) _lists_in_program.Add(new FirePlayList(h)); file_list_box.Items.AddRange(new_files); if (_files == null) { _files = new_files; } else { List <string> temp = _files.ToList(); temp.AddRange(new_files); _files = temp.ToArray(); } } AddToRightClickFunction(); ColorSetup(); Stylize(); WindowColors.GetBackLog(); UpdateCheckedItemsInLoadToolStripMenu(); WindowColors.CheckCheckedColorSchemesInToolStrip += UpdateCheckedItemsInLoadToolStripMenu; }
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////// CONSTRUCTOR /////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// public Sweeper_Form(int z, StartingWindowForm main_window) { InitializeComponent(); this.Panel_Options = new PanelOptions(panel1); panel1.BackColor = System.Drawing.ColorTranslator.FromHtml("#888888"); SongView.ShowAll(); this.Show(); _main_window = main_window; Setup(); this.AllowDrop = true; //enables drag-n-drop functionaity this.DragEnter += new DragEventHandler(DragEnter_); //Drag-n-drop funcitonality this.DragDrop += new DragEventHandler(DragDrop_); //Drag-n-drop funcitonality this.SizeChanged += new EventHandler(Changed); //Should reacto to window size change tabControl1.SelectedIndex = z; this.KeyPreview = true; this.KeyPress += KeyPressed; this.KeyDown += KeyDowned; }
private void export_button_Click(object sender, EventArgs e) { //SaveList(EPClass.ExportList); StartingWindowForm.SavePlaylistToFileAsPlainTextXML(Location, EPClass.ExportList); this.Close(); }