コード例 #1
0
 public SettingsEditorForm(
     ApplicationPreferences preferences
     )
 {
     Preferences = preferences;
     InitializeComponent();
 }
コード例 #2
0
        public SettingsEditorForm(
            )
        {
            _preferences = ApplicationPreferences.GetDefaultPreferences();
            InitializeComponent();

            // this.isolatedStorageSettingsControl
        }
コード例 #3
0
 private void settingsToolStripButton_Click(object sender, EventArgs e)
 {
     var editorForm =
         new SettingsEditorForm();
     editorForm.Preferences = _preferences;
     editorForm.ShowDialog();
     if (setNewPreferences(_preferences, editorForm.Preferences))
     {
         _preferences = editorForm.Preferences;
         SerializationUtility.Serialize2File(_preferences, _preferences.Path, false, false);
     }
 }
コード例 #4
0
 private bool setNewPreferences(
     ApplicationPreferences oldPreferences,
     ApplicationPreferences newPreferences
     )
 {
     try
     {
         // Call all recepients one by one and provide actions for rolling
         // changes back
         // = editorForm.Preferences;
         _preferences.IsolatedStorageSettings = newPreferences.IsolatedStorageSettings;
         return true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Changes will not be applied! Reason:" + ex);
         return false;
     }
 }
コード例 #5
0
 public static ApplicationPreferences GetDefaultPreferences()
 {
     var retVal = new ApplicationPreferences();
     retVal.Path = AssemblyInfoUtility.ApplicationSettingsCommonDirectory + @"\preferences.xml";
     return retVal;
 }