wasStitchNET – Diff between revs 20 and 21
?pathlinks?
Rev 20 | Rev 21 | |||
---|---|---|---|---|
Line 368... | Line 368... | |||
368 | |
368 | |
|
Line 369... | Line 369... | |||
369 | StitchProgressUpdate("Patching files."); |
369 | StitchProgressUpdate("Patching files."); |
|
370 | |
370 | |
|
371 | // Retrive working file. |
371 | // Retrive working file. |
|
Line 372... | Line 372... | |||
372 | var workingFilePath = string.Join(Path.DirectorySeparatorChar.ToString(), |
372 | var workingFilePath = string.Join(Path.DirectorySeparatorChar.ToString(), |
|
373 | path, Constants.WORKING_CONFIGURATION_FILE); |
373 | path, STITCH_CONSTANTS.WORKING_CONFIGURATION_FILE); |
|
374 | |
374 | |
|
375 | StitchProgressUpdate("Parsing working file to be patched."); |
375 | StitchProgressUpdate("Parsing working file to be patched."); |
|
Line 387... | Line 387... | |||
387 | StitchProgressUpdate("Parsing default file to be patched."); |
387 | StitchProgressUpdate("Parsing default file to be patched."); |
|
388 | XDocument defaultFile; |
388 | XDocument defaultFile; |
|
389 | try |
389 | try |
|
390 | { |
390 | { |
|
391 | defaultFile = XDocument.Load(string.Join(Path.DirectorySeparatorChar.ToString(), |
391 | defaultFile = XDocument.Load(string.Join(Path.DirectorySeparatorChar.ToString(), |
|
392 | path, Constants.DEFAULT_CONFIGURATION_FILE)); |
392 | path, STITCH_CONSTANTS.DEFAULT_CONFIGURATION_FILE)); |
|
393 | } |
393 | } |
|
394 | catch (Exception ex) |
394 | catch (Exception ex) |
|
395 | { |
395 | { |
|
396 | throw new StitchException("Unable to parse default file to be patched.", ex); |
396 | throw new StitchException("Unable to parse default file to be patched.", ex); |
|
397 | } |
397 | } |
|
Line 418... | Line 418... | |||
418 | try |
418 | try |
|
419 | { |
419 | { |
|
420 | if (!dryrun) |
420 | if (!dryrun) |
|
421 | File.Copy(workingFilePath, |
421 | File.Copy(workingFilePath, |
|
422 | string.Join(Path.DirectorySeparatorChar.ToString(), |
422 | string.Join(Path.DirectorySeparatorChar.ToString(), |
|
423 | path, Constants.BACKUP_CONFIGURATION_FILE), true); |
423 | path, STITCH_CONSTANTS.BACKUP_CONFIGURATION_FILE), true); |
|
424 | } |
424 | } |
|
425 | catch (Exception ex) |
425 | catch (Exception ex) |
|
426 | { |
426 | { |
|
427 | throw new StitchException("Unable to create patched file backup.", ex); |
427 | throw new StitchException("Unable to create patched file backup.", ex); |
|
428 | } |
428 | } |
|
Line 431... | Line 431... | |||
431 | StitchProgressUpdate("Saving the patched file."); |
431 | StitchProgressUpdate("Saving the patched file."); |
|
432 | try |
432 | try |
|
433 | { |
433 | { |
|
434 | if (!dryrun) |
434 | if (!dryrun) |
|
435 | patchedFile.Save(string.Join(Path.DirectorySeparatorChar.ToString(), |
435 | patchedFile.Save(string.Join(Path.DirectorySeparatorChar.ToString(), |
|
436 | path, Constants.WORKING_CONFIGURATION_FILE)); |
436 | path, STITCH_CONSTANTS.WORKING_CONFIGURATION_FILE)); |
|
437 | } |
437 | } |
|
438 | catch (Exception ex) |
438 | catch (Exception ex) |
|
439 | { |
439 | { |
|
440 | throw new StitchException("Unable to save patched file.", ex); |
440 | throw new StitchException("Unable to save patched file.", ex); |
|
441 | } |
441 | } |