Exemplo n.º 1
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (_filePathUsers != null)
     {
         SettingsDocument doc = SettingsConverter.ConvertObjectToDocument(_settingsObject, _filePathUsers);
         doc.Save(_filePathUsers, SettingsFileOption.Encrypted);
         UpdateUsersSettings.SafeInvoke(this._settingsObject, e);
     }
 }
Exemplo n.º 2
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (_filePathUsers != null)
     {
         SettingsDocument doc = SettingsConverter.ConvertObjectToDocument(_settingsObject, _filePathUsers);
         doc.Save(_filePathUsers, SettingsFileOption.Encrypted);
         UpdateUsersSettings.SafeInvoke(this._settingsObject, e);
         Notify.PopUp("Configuration File Saved", "Updated settings have been saved to disk", "", "OK");
     }
 }
Exemplo n.º 3
0
        /*
         * private void CheckChangedItemDifference(GridItem item)
         * {
         *  Stack<string> names = new Stack<string>();
         *  GridItem gi = item;
         *
         *  while(gi != null)
         *  {
         *      names.Push(gi.PropertyDescriptor.Name);
         *      gi = gi.Parent;
         *  }
         *  names.Push(_cfgListView.SelectedItems[0].Text);
         *
         *  object obj = _settingsObject;
         *  while (names.Count > 0)
         *  {
         *      if (obj == null)
         *          return;
         *
         *      PropertyInfo[] propertyInfos = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
         *      PropertyInfo pi = Array.Find<PropertyInfo>(propertyInfos, p => p.Name == names.Peek());
         *
         *      if (pi == null)
         *          return;
         *
         *      obj = pi.GetValue(obj, null);
         *  }
         * }
         */

        /// <summary>
        /// Saves settings using settings document.
        /// </summary>
        protected override void OnSave()
        {
            SettingsDocument = SettingsConverter.ConvertObjectToDocument(_settingsObject, FilePath);
            base.OnSave();
        }