示例#1
0
        private void LoadScoreSettingsButton_Click(object sender, EventArgs e)
        {
            using(OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.InitialDirectory = M.Preferences.LocalMoritzScoresFolder;
                string filterString = @"Krystal Score Settings (*" + M.MoritzKrystalScoreSettingsExtension +
                    @")|*" + M.MoritzKrystalScoreSettingsExtension;
                // "Krystal Score Settings (*.mkss)|*.mkss";
                openFileDialog.Filter = filterString;
                openFileDialog.FilterIndex = (int)0;
                openFileDialog.Title = "Load Krystal Score Settings";
                openFileDialog.RestoreDirectory = true;

                if(openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string settingsPathname = openFileDialog.FileName;
                    if(!String.IsNullOrEmpty(settingsPathname))
                    {
                        _assistantComposerForm = new AssistantComposerForm(settingsPathname, (IMoritzForm1)this);
                        _assistantComposerForm.Show();
                        this.Hide();
                    }
                }
            }
        }
示例#2
0
 public void CloseAssistantComposer()
 {
     if(_assistantComposerForm != null && _assistantComposerForm.DiscardAnyChanges())
     {
         _assistantComposerForm.Close();
         _assistantComposerForm = null;
     }
     this.Show();
 }
 /// <summary>
 /// Creates a new, empty DimensionsAndMetadataForm.
 /// </summary>
 internal DimensionsAndMetadataForm(AssistantComposerForm assistantComposerForm, string settingsPath, FormStateFunctions fsf)
 {
     InitializeComponent();
     _assistantComposerForm = assistantComposerForm;
     _settingsPath = settingsPath; // used when reverting
     _fsf = fsf;
     _allTextBoxes = GetAllTextBoxes();
     SetDefaultValues();
 }