~gotopad/do-plugins/TimerApplet

« back to all changes in this revision

Viewing changes to Archive/src/ArchiveTypeItem.cs

Adding missing files and Archive plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ArchiveTypeItem.cs
 
2
//
 
3
//  Copyright (C) 2008 [name of author]
 
4
//
 
5
// This program is free software; you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation; either version 2 of the License, or
 
8
// (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
// GNU General Public License for more details.
 
14
// 
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; if not, write to the Free Software
 
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
18
//
 
19
 
 
20
using Do.Universe;
 
21
using Archive;
 
22
 
 
23
namespace Archive {
 
24
   
 
25
        public class ArchiveTypeItem : IItem
 
26
        {
 
27
                private string archiveName;
 
28
                private string archiveDescription;
 
29
                private int archiveId;
 
30
                private string archiveIcon;     
 
31
        
 
32
                public ArchiveTypeItem (Archive.ArchiveType archiveType)
 
33
                {
 
34
                        this.archiveId = (int)archiveType;
 
35
                        
 
36
                        switch (archiveId) {
 
37
                                case (int)Archive.ArchiveType.GZIP:
 
38
                                        this.archiveName = "Tar.gz";
 
39
                                        this.archiveDescription = "Tar compressed with GZIP (.tar.gz)";    
 
40
                                        this.archiveIcon = "tgz";
 
41
                                        break;
 
42
                                case (int)Archive.ArchiveType.BZIP2:
 
43
                                        this.archiveName = "Tar.bz2";
 
44
                                        this.archiveDescription = "Tar compressed with BZIP2 (.tar.bz2)"; 
 
45
                                        this.archiveIcon = "tar";
 
46
                                        break;
 
47
                                case (int)Archive.ArchiveType.TAR:
 
48
                                        this.archiveName = "Tar";
 
49
                                        this.archiveDescription = "Tar uncompressed (.tar)";
 
50
                                        this.archiveIcon = "tar";
 
51
                                        break;
 
52
                                case (int)Archive.ArchiveType.ZIP:
 
53
                                        this.archiveName = ".zip";
 
54
                                        this.archiveDescription = "Zip (.zip)";
 
55
                                        this.archiveIcon = "zip";
 
56
                                        break;   
 
57
                                default:
 
58
                                        this.archiveName = ".tar.gz";
 
59
                                        this.archiveDescription = "Tar compressed with GZIP (.tar.gz)";    
 
60
                                        this.archiveIcon = "tgz";
 
61
                                        break;
 
62
                        }
 
63
                }
 
64
                
 
65
                public int ArchiveType {
 
66
                        get { return archiveId; }
 
67
                }
 
68
                
 
69
                public string Name {
 
70
                        get { return archiveName; }
 
71
                }
 
72
                
 
73
                public string Description {
 
74
                        get { return archiveDescription; }
 
75
                }
 
76
                
 
77
                public string Icon {
 
78
                        get { return archiveIcon; }
 
79
                }
 
80
                
 
81
        }
 
82
}