Ejemplo n.º 1
0
 private void comboBox_Profile_SelectionChangeCommitted(object sender, EventArgs e)
 {
   if (comboBox_Profile.SelectedItem == null)
     return;
   string newName = comboBox_Profile.SelectedItem.ToString();
   if (_settings != null && string.Compare(_settings.ProfileName, newName, true) == 0)
     return;
   if (!PromptProfileModified())
   {
     // switch back to old profile
     UpdateButtonStates();
     return;
   }
   SceneExportProfile newProfile = SceneExportProfile.LoadProfile(EditorManager.Scene, newName, true);
   if (newProfile == null)
   {
     EditorManager.ShowMessageBox("Failed to load '" + newName + "'", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     UpdateButtonStates();
     return;
   }
   Settings = newProfile; // clone and apply to UI
   _settingsUnmodified = (SceneExportProfile)newProfile.Clone();
 }