Exemple #1
0
 public AlwaysAlignedConfiguration GetConfiguration()
 {
     if (Config == null)
     {
         Config = new AlwaysAlignedConfiguration
         {
             Enabled           = Settings.Default.Enabled,
             ConvertOnLoadSave = Settings.Default.ConvertOnLoadSave,
             MinimumCellWidth  = Settings.Default.MinimumCellWidth,
             CellPadding       = Settings.Default.CellPadding
         };
     }
     return(Config);
 }
Exemple #2
0
        public void Save(AlwaysAlignedConfiguration config)
        {
            bool hasChanges = Settings.Default.Enabled != config.Enabled;

            Settings.Default.Enabled = config.Enabled;

            hasChanges = hasChanges || (Settings.Default.ConvertOnLoadSave != config.ConvertOnLoadSave);
            Settings.Default.ConvertOnLoadSave = config.ConvertOnLoadSave;

            hasChanges = hasChanges || (Settings.Default.MinimumCellWidth != config.MinimumCellWidth);
            Settings.Default.MinimumCellWidth = (int)config.MinimumCellWidth;

            hasChanges = hasChanges || (Settings.Default.CellPadding != config.CellPadding);
            Settings.Default.CellPadding = (int)config.CellPadding;

            Settings.Default.Save();

            //Refresh config
            Config = null;
            OnConfigurationSaved(new ConfigurationSavedEventArgs {
                HasChanges = hasChanges
            });
        }
Exemple #3
0
 public SettingsDialog()
 {
     config = (AlwaysAlignedConfiguration)AlwaysAlignedConfigurationService.Instance.GetConfiguration().Clone();
     InitializeComponent();
     postInit = true;
 }