39
39
40
40
namespace ICSharpCode . SharpZipLib . Core
41
41
{
42
+ /// <summary>
43
+ /// Event arguments for scanning.
44
+ /// </summary>
42
45
public class ScanEventArgs : EventArgs
43
46
{
47
+ /// <summary>
48
+ /// Initialise a new instance of <see cref="ScanEventArgs"/>
49
+ /// </summary>
50
+ /// <param name="name"></param>
44
51
public ScanEventArgs ( string name )
45
52
{
46
53
this . name = name ;
@@ -49,35 +56,44 @@ public ScanEventArgs(string name)
49
56
50
57
string name ;
51
58
59
+ /// <summary>
60
+ /// The name for this event.
61
+ /// </summary>
52
62
public string Name
53
63
{
54
64
get { return name ; }
55
65
}
56
66
57
67
bool continueRunning ;
58
68
69
+ /// <summary>
70
+ /// Get set a value indicating if scanning should continue or not.
71
+ /// </summary>
59
72
public bool ContinueRunning
60
73
{
61
74
get { return continueRunning ; }
62
75
set { continueRunning = value ; }
63
76
}
64
77
}
65
78
79
+ /// <summary>
80
+ /// Event arguments for directories.
81
+ /// </summary>
66
82
public class DirectoryEventArgs : ScanEventArgs
67
83
{
68
84
/// <summary>
69
- /// Initialize an instance of <see cref="DirectoryEventsArgs "></see>.
85
+ /// Initialize an instance of <see cref="DirectoryEventArgs "></see>.
70
86
/// </summary>
71
87
/// <param name="name">The name for this directory.</param>
72
- /// <param name="isEmpty ">Flag value indicating if any matching files are contained in this directory.</param>
88
+ /// <param name="hasMatchingFiles ">Flag value indicating if any matching files are contained in this directory.</param>
73
89
public DirectoryEventArgs ( string name , bool hasMatchingFiles )
74
90
: base ( name )
75
91
{
76
92
this . hasMatchingFiles = hasMatchingFiles ;
77
93
}
78
94
79
95
/// <summary>
80
- /// Geta value indicating if the directory contains any matching files or not.
96
+ /// Get a value indicating if the directory contains any matching files or not.
81
97
/// </summary>
82
98
public bool HasMatchingFiles
83
99
{
@@ -87,8 +103,16 @@ public bool HasMatchingFiles
87
103
bool hasMatchingFiles ;
88
104
}
89
105
106
+ /// <summary>
107
+ /// Arguments passed when scan failures are detected.
108
+ /// </summary>
90
109
public class ScanFailureEventArgs
91
110
{
111
+ /// <summary>
112
+ /// Initialise a new instance of <see cref="ScanFailureEventArgs"></see>
113
+ /// </summary>
114
+ /// <param name="name">The name to apply.</param>
115
+ /// <param name="e">The exception to use.</param>
92
116
public ScanFailureEventArgs ( string name , Exception e )
93
117
{
94
118
this . name = name ;
@@ -97,29 +121,55 @@ public ScanFailureEventArgs(string name, Exception e)
97
121
}
98
122
99
123
string name ;
124
+
125
+ /// <summary>
126
+ /// The applicable name.
127
+ /// </summary>
100
128
public string Name
101
129
{
102
130
get { return name ; }
103
131
}
104
132
105
133
Exception exception ;
134
+
135
+ /// <summary>
136
+ /// The applicable exception.
137
+ /// </summary>
106
138
public Exception Exception
107
139
{
108
140
get { return exception ; }
109
141
}
110
142
111
143
bool continueRunning ;
112
144
145
+ /// <summary>
146
+ /// Get / set a value indicating wether scanning should continue.
147
+ /// </summary>
113
148
public bool ContinueRunning
114
149
{
115
150
get { return continueRunning ; }
116
151
set { continueRunning = value ; }
117
152
}
118
153
}
119
154
155
+ /// <summary>
156
+ /// Delegate invokked when a directory is processed.
157
+ /// </summary>
120
158
public delegate void ProcessDirectoryDelegate ( object Sender , DirectoryEventArgs e ) ;
159
+
160
+ /// <summary>
161
+ /// Delegate invoked when a file is processed.
162
+ /// </summary>
121
163
public delegate void ProcessFileDelegate ( object sender , ScanEventArgs e ) ;
164
+
165
+ /// <summary>
166
+ /// Delegate invoked when a directory failure is detected.
167
+ /// </summary>
122
168
public delegate void DirectoryFailureDelegate ( object sender , ScanFailureEventArgs e ) ;
169
+
170
+ /// <summary>
171
+ /// Delegate invoked when a file failure is detected.
172
+ /// </summary>
123
173
public delegate void FileFailureDelegate ( object sender , ScanFailureEventArgs e ) ;
124
174
125
175
/// <summary>
@@ -128,7 +178,7 @@ public bool ContinueRunning
128
178
public class FileSystemScanner
129
179
{
130
180
/// <summary>
131
- /// Initialise a new instance of <see cref="FileScanner "></see>
181
+ /// Initialise a new instance of <see cref="FileSystemScanner "></see>
132
182
/// </summary>
133
183
/// <param name="filter">The file filter to apply when scanning.</param>
134
184
public FileSystemScanner ( string filter )
@@ -139,31 +189,59 @@ public FileSystemScanner(string filter)
139
189
/// <summary>
140
190
/// Initialise a new instance of <see cref="FileSystemScanner"></see>
141
191
/// </summary>
142
- /// <param name="fileFilter"></param>
192
+ /// <param name="fileFilter">The file <see cref="NameFilter"></see>filter to apply. </param>
143
193
/// <param name="directoryFilter">The directory <see cref="NameFilter"></see>filter to apply.</param>
144
194
public FileSystemScanner ( string fileFilter , string directoryFilter )
145
195
{
146
196
this . fileFilter = new PathFilter ( fileFilter ) ;
147
197
this . directoryFilter = new PathFilter ( directoryFilter ) ;
148
198
}
149
199
200
+ /// <summary>
201
+ /// Initialise a new instance of <see cref="FileSystemScanner"></see>
202
+ /// </summary>
203
+ /// <param name="fileFilter">The file <see cref="NameFilter"></see>filter to apply.</param>
150
204
public FileSystemScanner ( IScanFilter fileFilter )
151
205
{
152
206
this . fileFilter = fileFilter ;
153
207
}
154
208
209
+ /// <summary>
210
+ /// Initialise a new instance of <see cref="FileSystemScanner"></see>
211
+ /// </summary>
212
+ /// <param name="fileFilter">The file <see cref="IScanFilter"></see>filter to apply.</param>
213
+ /// <param name="directoryFilter">The directory <see cref="IScanFilter"></see>filter to apply.</param>
155
214
public FileSystemScanner ( IScanFilter fileFilter , IScanFilter directoryFilter )
156
215
{
157
216
this . fileFilter = fileFilter ;
158
217
this . directoryFilter = directoryFilter ;
159
218
}
160
219
220
+ /// <summary>
221
+ /// Delegate to invoke when a directory is processed.
222
+ /// </summary>
161
223
public ProcessDirectoryDelegate ProcessDirectory ;
224
+
225
+ /// <summary>
226
+ /// Delegate to invoke when a file is processed.
227
+ /// </summary>
162
228
public ProcessFileDelegate ProcessFile ;
163
229
230
+ /// <summary>
231
+ /// Delegate to invoke when a directory failure is detected.
232
+ /// </summary>
164
233
public DirectoryFailureDelegate DirectoryFailure ;
234
+
235
+ /// <summary>
236
+ /// Delegate to invoke when a file failure is detected.
237
+ /// </summary>
165
238
public FileFailureDelegate FileFailure ;
166
239
240
+ /// <summary>
241
+ /// Raise the DirectoryFailure event.
242
+ /// </summary>
243
+ /// <param name="directory">Rhe directory name.</param>
244
+ /// <param name="e">The exception detected.</param>
167
245
public void OnDirectoryFailure ( string directory , Exception e )
168
246
{
169
247
if ( DirectoryFailure == null ) {
@@ -175,6 +253,11 @@ public void OnDirectoryFailure(string directory, Exception e)
175
253
}
176
254
}
177
255
256
+ /// <summary>
257
+ /// Raise the FileFailure event.
258
+ /// </summary>
259
+ /// <param name="file">The file name.</param>
260
+ /// <param name="e">The exception detected.</param>
178
261
public void OnFileFailure ( string file , Exception e )
179
262
{
180
263
if ( FileFailure == null ) {
@@ -185,7 +268,11 @@ public void OnFileFailure(string file, Exception e)
185
268
alive = args . ContinueRunning ;
186
269
}
187
270
}
188
-
271
+
272
+ /// <summary>
273
+ /// Raise the ProcessFile event.
274
+ /// </summary>
275
+ /// <param name="file">The file name.</param>
189
276
public void OnProcessFile ( string file )
190
277
{
191
278
if ( ProcessFile != null ) {
@@ -195,6 +282,11 @@ public void OnProcessFile(string file)
195
282
}
196
283
}
197
284
285
+ /// <summary>
286
+ /// Raise the ProcessDirectory event.
287
+ /// </summary>
288
+ /// <param name="directory">The directory name.</param>
289
+ /// <param name="hasMatchingFiles">Flag indicating if the directory has matching files.</param>
198
290
public void OnProcessDirectory ( string directory , bool hasMatchingFiles )
199
291
{
200
292
if ( ProcessDirectory != null ) {
0 commit comments