Example #1
0
        public Options(ArchiveManagerSettingInfo settings)
            : this()
        {
            _settings = settings;

            cbxLevel.SelectedIndex = settings.CompressionLevel;

            switch (_settings.CompressionMethod)
            {
            case CompressionMethod.None:
                cbxCompressionMethod.SelectedIndex = 0;
                break;

            case CompressionMethod.Deflate:
                cbxCompressionMethod.SelectedIndex = 1;
                break;

            case CompressionMethod.BZIP2:
                cbxCompressionMethod.SelectedIndex = 2;
                break;

            case CompressionMethod.PPMd:
                cbxCompressionMethod.SelectedIndex = 3;
                break;
            }

            cbxPath.SelectedIndex = (int)settings.PathStoringMode;
            chkRecursive.Checked  = settings.Recursive;
        }
        /// <summary>
        /// Loads settings from the Registry.
        /// </summary>
        /// <returns>The ArchiveManagerSettingInfo class.</returns>
        public static ArchiveManagerSettingInfo LoadConfig()
        {
            ArchiveManagerSettingInfo s = new ArchiveManagerSettingInfo();

            s._compressionLevel  = Util.GetIntProperty("CompressionLevel", 6);
            s._compressionMethod = (CompressionMethod)Util.GetIntProperty("CompressionMethod", (int)ComponentPro.Compression.CompressionMethod.Deflate);
            s._pathStoringMode   = (ZipPathStoringMode)Util.GetIntProperty("PathStoringMode", (int)ZipPathStoringMode.RelativePath);
            s._recursive         = (string)Util.GetProperty("Recursive", "True") == "True";

            s._syncAttributes           = (string)Util.GetProperty("SyncAttributes", "True") == "True";
            s._syncTime                 = (string)Util.GetProperty("SyncDateTime", "True") == "True";
            s._syncCheckForResumability = (string)Util.GetProperty("SyncCheckForResumability", "True") == "True";
            s._syncDeleteFiles          = (string)Util.GetProperty("SyncDeleteFiles", "True") == "True";
            s._syncSearchPattern        = (string)Util.GetProperty("SyncSearchPattern", "*.*");
            s._syncComparisonMethod     = Util.GetIntProperty("SyncComparisonMethod", 0);
            s._syncSourceDir            = (string)Util.GetProperty("SyncSourceDir", "");

            s._progressUpdateInterval = Util.GetIntProperty("ProgressUpdateInterval", 50);

            s._sfxStubFile   = (string)Util.GetProperty("SfxStubFile", Util.DataDir + "\\SfxStubSelfExtractor.exe");
            s._sfxOutputFile = (string)Util.GetProperty("SfxOutputFile", Util.OutputDir + "\\SelfExtractor.exe");

            return(s);
        }