Use this to configure the a resize job. After you start the job, do not modify this instance.
More...
|
| BatchResizeSettings (string destinationFile, Guid jobId, IList< BatchResizeItem > files) |
| Use this to configure a batch resize job. Mutable. Remember to assign at least a JobEvent handler so you know the fate of the job. More...
|
|
void | FixDuplicateFilenames (string prefix="_") |
| Loops through all files, assigning targetFilenames if they are null, and eliminating duplicate names by adding _1, _2, etc. Also normalizes filenames for use in zip folder. Used internally. May be used externally also if calling code wishes to to know the final file names. More...
|
|
|
static string | NormalizePathForUseInZipFile (string pathName) |
| Utility routine for transforming path names from filesystem format (on Windows that means backslashes) to a format suitable for use within zipfiles. This means trimming the volume letter and colon (if any) And swapping backslashes for forward slashes. More...
|
|
|
ItemCallback | ItemEvent |
| Fired when a file is successfully written to the zip file, or if an item fails to be added to the zip file. Will execute on a thread pool thread. Catch all your exeptions, or they will cause the jobe to fail. Set e.Cancel to cancel the job. Uses the same thread the job is processing on - I/O bound tasks in handlers should be async if possible. More...
|
|
JobCallback | JobEvent |
| Fires when the Zip file has successfully been written to disk, when the job fails. Will execute on a thread pool thread. Catch all your exeptions, or they will cause the asp.net proccess to restart! More...
|
|
Use this to configure the a resize job. After you start the job, do not modify this instance.
Definition at line 117 of file BatchJobSettings.cs.
ImageResizer.Plugins.BatchZipper.BatchResizeSettings.BatchResizeSettings |
( |
string |
destinationFile, |
|
|
Guid |
jobId, |
|
|
IList< BatchResizeItem > |
files |
|
) |
| |
|
inline |
Use this to configure a batch resize job. Mutable. Remember to assign at least a JobEvent handler so you know the fate of the job.
- Parameters
-
jobId | The job ID, can be generated with Guid.NewGuid() |
destinationFile | The physical path to the destination archive |
files | A List<BatchResizeItem> of items to to resize and place in the folder. |
Definition at line 126 of file BatchJobSettings.cs.
129 this.destinationFile = destinationFile;
131 this.conf = Config.Current;
void ImageResizer.Plugins.BatchZipper.BatchResizeSettings.FixDuplicateFilenames |
( |
string |
prefix = "_" | ) |
|
|
inline |
Loops through all files, assigning targetFilenames if they are null, and eliminating duplicate names by adding _1, _2, etc. Also normalizes filenames for use in zip folder. Used internally. May be used externally also if calling code wishes to to know the final file names.
Definition at line 169 of file BatchJobSettings.cs.
171 HashSet<string> names =
new HashSet<string>(StringComparer.OrdinalIgnoreCase);
172 foreach (BatchResizeItem i
in files)
175 if (i.TargetFilename == null) i.TargetFilename = System.IO.Path.GetFileNameWithoutExtension(i.PhysicalPath);
178 if (names.Contains(i.TargetFilename))
182 string next = i.TargetFilename + prefix + index;
183 while (names.Contains(next))
186 next = i.TargetFilename + prefix + index;
188 i.TargetFilename = next;
195 names.Add(i.TargetFilename);
static string NormalizePathForUseInZipFile(string pathName)
Utility routine for transforming path names from filesystem format (on Windows that means backslashes...
static string ImageResizer.Plugins.BatchZipper.BatchResizeSettings.NormalizePathForUseInZipFile |
( |
string |
pathName | ) |
|
|
inlinestatic |
Utility routine for transforming path names from filesystem format (on Windows that means backslashes) to a format suitable for use within zipfiles. This means trimming the volume letter and colon (if any) And swapping backslashes for forward slashes.
- Parameters
-
- Returns
- transformed path
Definition at line 206 of file BatchJobSettings.cs.
209 if (String.IsNullOrEmpty(pathName))
return pathName;
212 if ((pathName.Length >= 2) && ((pathName[1] ==
':') && (pathName[2] ==
'\\')))
213 pathName = pathName.Substring(3);
216 pathName = pathName.Replace(
'\\',
'/');
219 while (pathName.StartsWith(
"/")) pathName = pathName.Substring(1);
221 return SimplifyFwdSlashPath(pathName);
ItemCallback ImageResizer.Plugins.BatchZipper.BatchResizeSettings.ItemEvent |
Fired when a file is successfully written to the zip file, or if an item fails to be added to the zip file. Will execute on a thread pool thread. Catch all your exeptions, or they will cause the jobe to fail. Set e.Cancel to cancel the job. Uses the same thread the job is processing on - I/O bound tasks in handlers should be async if possible.
Definition at line 147 of file BatchJobSettings.cs.
JobCallback ImageResizer.Plugins.BatchZipper.BatchResizeSettings.JobEvent |
Fires when the Zip file has successfully been written to disk, when the job fails. Will execute on a thread pool thread. Catch all your exeptions, or they will cause the asp.net proccess to restart!
Definition at line 152 of file BatchJobSettings.cs.
The documentation for this class was generated from the following file: