Example #1
0
        /// <summary>
        /// Handles the FinishButtonClick event of the wizardControl1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void WizardControl1_FinishButtonClick(object sender, EventArgs e)
        {
            //generate the compilation with the tracks.
            ICompilation compilation = CompilationFactory.CreateNew();

            compilation.Title = _tbCollectionName.Text;

            //create tracks
            foreach (string trackMediaFile in _tbTrackMediaFiles.Lines)
            {
                Track newTrack = new Track {
                    Album  = _tbCommonAlbum.Text,
                    Artist = _tbCommonArtist.Text,
                    Name   = Path.GetFileNameWithoutExtension(trackMediaFile),
                    Url    = trackMediaFile
                };
                //create initial cue
                newTrack.Cues.Add(
                    new Cue {
                    Description = "Intro (autogenerated)",
                    Shortcut    = "1",
                    Time        = 0
                });
                compilation.Tracks.Add(newTrack);
            }

            Core.Model.Instance.Compilation = compilation; //assign to model.
            DialogResult = DialogResult.OK;
            Close();
        }