@@ -476,7 +476,7 @@ bool SetArgs(string[] args) {
476476 }
477477
478478 if ( fileSpecs . Count > 0 && operation == Operation . Create ) {
479- string checkPath = ( string ) fileSpecs [ 0 ] ;
479+ var checkPath = ( string ) fileSpecs [ 0 ] ;
480480 int deviceCheck = checkPath . IndexOf ( ':' ) ;
481481#if NETCF_1_0
482482 if ( checkPath . IndexOfAny ( Path . InvalidPathChars ) >= 0
@@ -603,7 +603,7 @@ void ListZip(string fileName) {
603603 const string headerTitles = "Name Length Ratio Size Date & time CRC-32" ;
604604 const string headerUnderline = "--------------- ---------- ----- ---------- ------------------- --------" ;
605605
606- FileInfo fileInfo = new FileInfo ( fileName ) ;
606+ var fileInfo = new FileInfo ( fileName ) ;
607607
608608 if ( fileInfo . Exists == false ) {
609609 Console . WriteLine ( "No such file exists {0}" , fileName ) ;
@@ -682,7 +682,7 @@ void ListZipViaZipFile(string fileName) {
682682 const string headerTitles = "Name Length Ratio Size Date & time CRC-32 Attr" ;
683683 const string headerUnderline = "------------ ---------- ----- ---------- ------------------- -------- ------" ;
684684
685- FileInfo fileInfo = new FileInfo ( fileName ) ;
685+ var fileInfo = new FileInfo ( fileName ) ;
686686
687687 if ( fileInfo . Exists == false ) {
688688 Console . WriteLine ( "No such file exists {0}" , fileName ) ;
@@ -837,8 +837,8 @@ string CookZipEntryName(string name)
837837 /// </summary>
838838 void AddFileSeekableOutput ( string file , string entryPath )
839839 {
840- ZipEntry entry = new ZipEntry ( entryPath ) ;
841- FileInfo fileInfo = new FileInfo ( file ) ;
840+ var entry = new ZipEntry ( entryPath ) ;
841+ var fileInfo = new FileInfo ( file ) ;
842842 entry . DateTime = fileInfo . LastWriteTime ; // or DateTime.Now or whatever, for now use the file
843843 entry . ExternalFileAttributes = ( int ) fileInfo . Attributes ;
844844 entry . Size = fileInfo . Length ;
@@ -904,7 +904,7 @@ void AddFolder(string folderName)
904904 folderName = folderName + '/' ;
905905 }
906906
907- ZipEntry zipEntry = new ZipEntry ( folderName ) ;
907+ var zipEntry = new ZipEntry ( folderName ) ;
908908 outputStream . PutNextEntry ( zipEntry ) ;
909909 }
910910
@@ -947,7 +947,7 @@ int CompressFolder(string basePath, bool recursiveSearch, string searchPattern)
947947 /// </summary>
948948 void Create ( ArrayList fileSpecifications )
949949 {
950- string zipFileName = fileSpecifications [ 0 ] as string ;
950+ var zipFileName = fileSpecifications [ 0 ] as string ;
951951 if ( Path . GetExtension ( zipFileName ) . Length == 0 ) {
952952 zipFileName = Path . ChangeExtension ( zipFileName , ".zip" ) ;
953953 }
@@ -1162,7 +1162,7 @@ void Extract(ArrayList fileSpecifications)
11621162
11631163 void Test ( ArrayList fileSpecs )
11641164 {
1165- string zipFileName = fileSpecs [ 0 ] as string ;
1165+ var zipFileName = fileSpecs [ 0 ] as string ;
11661166 if ( Path . GetExtension ( zipFileName ) . Length == 0 ) {
11671167 zipFileName = Path . ChangeExtension ( zipFileName , ".zip" ) ;
11681168 }
@@ -1182,7 +1182,7 @@ void Test(ArrayList fileSpecs)
11821182 /// <param name="fileSpecs">The file specs to operate on.</param>
11831183 void Delete ( ArrayList fileSpecs )
11841184 {
1185- string zipFileName = fileSpecs [ 0 ] as string ;
1185+ var zipFileName = fileSpecs [ 0 ] as string ;
11861186 if ( Path . GetExtension ( zipFileName ) . Length == 0 ) {
11871187 zipFileName = Path . ChangeExtension ( zipFileName , ".zip" ) ;
11881188 }
@@ -1198,7 +1198,7 @@ void Delete(ArrayList fileSpecs)
11981198
11991199 void Add ( ArrayList fileSpecs )
12001200 {
1201- string zipFileName = fileSpecs [ 0 ] as string ;
1201+ var zipFileName = fileSpecs [ 0 ] as string ;
12021202 if ( Path . GetExtension ( zipFileName ) . Length == 0 ) {
12031203 zipFileName = Path . ChangeExtension ( zipFileName , ".zip" ) ;
12041204 }
@@ -1264,7 +1264,7 @@ void Execute(string[] args) {
12641264 /// </param>
12651265 public static void Main ( string [ ] args ) {
12661266
1267- SharpZipArchiver sza = new SharpZipArchiver ( ) ;
1267+ var sza = new SharpZipArchiver ( ) ;
12681268 sza . Execute ( args ) ;
12691269 }
12701270
0 commit comments