2323namespace TidyBackups
2424{
2525 /// <summary>
26- /// Class for the Compression logic
26+ /// Class for the Compression logic
2727 /// </summary>
2828 internal class Compress
2929 {
3030 protected internal static void Archive ( string path , bool safe )
3131 {
32- string [ ] files = Directory . GetFiles ( path ) ;
33- foreach ( string file in files )
32+ var files = Directory . GetFiles ( path ) ;
33+ foreach ( var file in files )
3434 {
3535 if ( Name . ToCompress ( file ) )
3636 {
@@ -40,17 +40,17 @@ protected internal static void Archive(string path, bool safe)
4040 }
4141
4242 /// <summary>
43- /// Runs logic for creating zip, it'll do a bit of last min checking first.
43+ /// Runs logic for creating zip, it'll do a bit of last min checking first.
4444 /// </summary>
4545 /// <param name="path"></param>
4646 /// <param name="safe"></param>
4747 protected internal static void CompressZip ( string path , bool safe )
4848 {
49- string dir = Name . GetDir ( path ) ;
50- string nam = Name . GetName ( path ) ;
51- string ext = Name . GetExt ( path ) ;
52- DateTime created = Stamp . Get ( path ) ;
53- string name = path . Replace ( ext , ".zip" ) ;
49+ var dir = Name . GetDir ( path ) ;
50+ var nam = Name . GetName ( path ) ;
51+ var ext = Name . GetExt ( path ) ;
52+ var created = Stamp . Get ( path ) ;
53+ var name = path . Replace ( ext , ".zip" ) ;
5454 if ( ! File . Exists ( name ) )
5555 {
5656 Write ( name , dir , nam ) ;
@@ -67,8 +67,8 @@ protected internal static void CompressZip(string path, bool safe)
6767 else
6868 {
6969 // If the compressed file is not corrupt. We'll give it a new name, based on the time.
70- string dt = String . Format ( "_{0:yyyy-MM-dd_hh-mm-ss}.zip" , DateTime . Now ) ;
71- string newname = path . Replace ( ext , dt ) ;
70+ var dt = String . Format ( "_{0:yyyy-MM-dd_hh-mm-ss}.zip" , DateTime . Now ) ;
71+ var newname = path . Replace ( ext , dt ) ;
7272 Write ( newname , dir , nam ) ;
7373 Stamp . Set ( newname , created ) ;
7474 Message . Print ( " COMPRESSED " + path ) ;
@@ -79,15 +79,15 @@ protected internal static void CompressZip(string path, bool safe)
7979 }
8080
8181 /// <summary>
82- /// Checks zip is able to be opened and valid.
82+ /// Checks zip is able to be opened and valid.
8383 /// </summary>
8484 /// <param name="path"></param>
8585 /// <param name="name"></param>
8686 /// <param name="safe"></param>
8787 /// <returns></returns>
8888 protected internal static bool Read ( string path , string name , bool safe )
8989 {
90- bool value = false ;
90+ var value = false ;
9191 try
9292 {
9393 using ( var s = new ZipInputStream ( File . OpenRead ( path ) ) )
@@ -131,7 +131,7 @@ protected internal static bool Read(string path, string name, bool safe)
131131 }
132132
133133 /// <summary>
134- /// Creates the zip
134+ /// Creates the zip
135135 /// </summary>
136136 /// <param name="filename"></param>
137137 /// <param name="dir"></param>
0 commit comments