ARCed.Forms.ARChiveForm.CreateARChive C# (CSharp) Method

CreateARChive() private method

private CreateARChive ( BackupType type ) : void
type BackupType
return void
        private void CreateARChive(BackupType type)
        {
            if (this.compressor == null)
            {
                SevenZipBase.SetLibraryPath(PathHelper.SevenZipLibrary);
                this.compressor = new SevenZipCompressor(Path.GetTempPath())
                {
                    ArchiveFormat = OutArchiveFormat.SevenZip,
                    CompressionLevel = CompressionLevel.Ultra,
                    CompressionMethod = CompressionMethod.Lzma2,
                    CompressionMode = CompressionMode.Create,
                    EventSynchronization = EventSynchronizationStrategy.AlwaysAsynchronous
                };
                this.compressor.Compressing += this.compressor_Compressing;
                this.compressor.CompressionFinished += this.compressor_CompressionFinished;
            }
            var paths = new List<string>();
            this._archiveName = Path.Combine(Project.BackupDirectory, String.Format("{0}.7z", Guid.NewGuid()));
            if (type.HasFlag(BackupType.AllData))
                paths.Add(Path.Combine(Project.ProjectFolder, Project.DataDirectory));
            else
            {
                if (type.HasFlag(BackupType.Scripts))
                    paths.Add(Path.Combine(Project.ProjectFolder, Project.ScriptsDirectory));
                if (type.HasFlag(BackupType.Maps))
                {
                    var info = new DirectoryInfo(Project.DataDirectory);
                    paths.AddRange(info.GetFiles("*Map*.arc").Select(file =>
                        Path.Combine(Project.ProjectFolder, file.FullName)));
                }
            }
            if (paths.Count == 0)
                this.compressor_CompressionFinished(null, null);
            else
                this.AddToArchive(this._archiveName, paths);
            Console.WriteLine(String.Join(",\n", paths));
        }