예제 #1
0
 /// <summary>
 /// Encoding constructor
 /// </summary>
 public LZWArgs(string input, string output, LZWSettings setting)
 {
     InputFilename = input;
     OutputFilename = output;
     Settings = setting;
 }
예제 #2
0
 /// <summary>
 /// Decoding constructor
 /// </summary>
 public LZWArgs(string input, string output)
 {
     InputFilename = input;
     OutputFilename = output;
     Settings = null;
 }
예제 #3
0
 /// <summary>
 /// Makes a copy of an LZWSettings object
 /// </summary>
 public LZWSettings(LZWSettings copyFrom)
 {
     MaxBits = copyFrom.MaxBits;
     ShouldPrune = copyFrom.ShouldPrune;
     PruneWindow = copyFrom.PruneWindow;
     InitEmpty = copyFrom.InitEmpty;
 }
예제 #4
0
 public SettingsViewModel()
 {
     _oldSettings = LZWSettings.Current;
     _settings = new LZWSettings(_oldSettings);
     _integrateWithShell = RegistryMaster.IsIntegrated;
 }
예제 #5
0
        public static void UpdateSettings(LZWSettings settings)
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var appSettings = config.AppSettings.Settings;

            appSettings.Remove("MaxBits");
            appSettings.Remove("Pruning");
            appSettings.Remove("PruneWindow");
            appSettings.Remove("InitEmptyStringTable");

            appSettings.Add("MaxBits", Convert.ToString(settings.MaxBits));
            appSettings.Add("Pruning", Convert.ToString(settings.ShouldPrune));
            appSettings.Add("PruneWindow", Convert.ToString(settings.PruneWindow));
            appSettings.Add("InitEmptyStringTable", Convert.ToString(settings.InitEmpty));

            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
        }