Exemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the buttonChange control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by Dev02, 2008-01-10</remarks>
        private void buttonChange_Click(object sender, EventArgs e)
        {
            string soundFile = string.Empty;
            CommentarySoundIdentifier?identifier = SelectedSoundID;

            if (identifier.HasValue && commentarySounds.ContainsKey(identifier.Value))
            {
                soundFile = commentarySounds[identifier.Value].Filename;
            }

            MLifter.Controls.AudioDialog audioDialog = new MLifter.Controls.AudioDialog();
            audioDialog.Path        = soundFile;
            audioDialog.DisplayText = SelectedSoundName;
            audioDialog.ShowDialog();

            if (audioDialog.Path != soundFile)
            {
                if (audioDialog.Path == string.Empty)
                {
                    if (identifier.HasValue && commentarySounds.ContainsKey(identifier.Value))
                    {
                        commentarySounds.Remove(identifier.Value);
                    }
                }
                else
                {
                    commentarySounds[identifier.Value] = dictionary.CreateMedia(EMedia.Audio, audioDialog.Path, true, true, false);
                }
                listbox_SelectedIndexChanged(null, new EventArgs());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the buttonChange control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks>Documented by Dev02, 2008-01-10</remarks>
        private void buttonChange_Click(object sender, EventArgs e)
        {
            string soundFile = string.Empty;
            CommentarySoundIdentifier? identifier = SelectedSoundID;

            if (identifier.HasValue && commentarySounds.ContainsKey(identifier.Value))
                soundFile = commentarySounds[identifier.Value].Filename;

            MLifter.Controls.AudioDialog audioDialog = new MLifter.Controls.AudioDialog();
            audioDialog.Path = soundFile;
            audioDialog.DisplayText = SelectedSoundName;
            audioDialog.ShowDialog();

            if (audioDialog.Path != soundFile)
            {
                if (audioDialog.Path == string.Empty)
                {
                    if (identifier.HasValue && commentarySounds.ContainsKey(identifier.Value))
                        commentarySounds.Remove(identifier.Value);
                }
                else
                {
                    commentarySounds[identifier.Value] = dictionary.CreateMedia(EMedia.Audio, audioDialog.Path, true, true, false);
                }
                listbox_SelectedIndexChanged(null, new EventArgs());
            }
        }