Esempio n. 1
0
        public override void SaveSettingsToStorage()
        {
            base.SaveSettingsToStorage();
            var newSettings = optionPageControl.GetSettingsFromUI();

            SettingsPersistenceManager.SaveSettings(newSettings);
            OnSettingsChanged();
        }
 private void RefreshParameterText()
 {
     if (action != null)
     {
         txtActionParams.Text = action.Parameters.Count > 0
             ? SettingsPersistenceManager.EncodeActionParameter(action.Parameters.First().Value)
             : string.Empty;
     }
 }
        private void tbtnExportFile_Click(object sender, EventArgs e)
        {
            var saveDialogResult = saveProfileDialog.ShowDialog(this);

            if (saveDialogResult == DialogResult.OK)
            {
                var mappingProfile = GetSettingsFromUI().MidiMappingProfile;
                SettingsPersistenceManager.SaveMappingsToFile(mappingProfile, saveProfileDialog.FileName);
            }
        }
        private void tbtnImportFile_Click(object sender, EventArgs e)
        {
            var openDialogResult = openProfileDialog.ShowDialog(this);

            if (openDialogResult == DialogResult.OK)
            {
                var mappingProfile = SettingsPersistenceManager.LoadMappingsFromFile(openProfileDialog.FileName);
                settings.MidiMappingProfile = mappingProfile;
                LoadMappings();
            }
        }
        private string GetExtendedParameterInput()
        {
            string initialValue = txtActionParams.Text;

            using (var extendedParamForm = new ActionExtendedParameterEditForm())
            {
                var formDisplayPoint = PointToScreen(new Point(txtActionParams.Left, txtActionParams.Top + txtActionParams.Height));
                extendedParamForm.Left = formDisplayPoint.X;
                extendedParamForm.Top  = formDisplayPoint.Y;

                extendedParamForm.LoadDataIntoUI(initialValue);
                var result = extendedParamForm.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    return(SettingsPersistenceManager.EncodeActionParameter(extendedParamForm.GetDataFromUI()));
                }
            }
            return(initialValue);
        }
 private void txtExtendedParams_TextChanged(object sender, EventArgs e)
 {
     lblEscapeWarning.Visible = SettingsPersistenceManager.StringNeedsToBeEscaped(txtExtendedParams.Text);
 }
 private void LoadSettings()
 {
     settings       = SettingsPersistenceManager.LoadSettings();
     mappingMatcher = new MidiMappingMatcher(settings.MidiMappingProfile);
 }
Esempio n. 8
0
 protected override void OnActivate(CancelEventArgs e)
 {
     base.OnActivate(e);
     optionPageControl.ApplySettingsToUI(SettingsPersistenceManager.LoadSettings());
 }