コード例 #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            using (SaveFileDialog sdlg = new SaveFileDialog())
            {
                var result = sdlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    //HTML file
                    string file = sdlg.FileName;
                    if (File.Exists(file))
                    {
                        File.Delete(file);
                    }
                    PathToHTML = file;

                    //CSS file
                    string fileXML = Path.GetFileNameWithoutExtension(file) + ".xml";
                    fileXML = Path.Combine(Path.GetDirectoryName(file), fileXML);
                    if (File.Exists(fileXML))
                    {
                        File.Delete(fileXML);
                    }

                    WriteToHTML();
                    SongOptions.SerializeJson(fileXML);

                    MessageBox.Show("DONE");
                }
            }
        }
コード例 #2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                SongOptions.SongTitle = txtSongName.Text;
                SongOptions.SetBPM(Convert.ToInt32(txtBPM.Text));

                StyleOptions.SizeOfQuarter = Convert.ToInt32(txtDistanceBeat.Text);
                StyleOptions.HeaderLength  = Convert.ToInt32(txtHeaderLength.Text);
                StyleOptions.ContentLength = Convert.ToInt32(txtChordLength.Text);

                MusicalStorage.DumpStorage();

                btnNewChord.Enabled = true;
                btnGenerate.Enabled = true;
                btnNewNote.Enabled  = true;
            }
            catch
            {
                MessageBox.Show("Please enter valid numbers");
            }
        }
コード例 #3
0
 public ISongFactory WithOptions(SongOptions options)
 {
     this.options = options;
     return(this);
 }