@@ -34,46 +34,53 @@ public static class ScreenshotCollection
3434
3535 public static void Add ( Screenshot newScreenshot , ScreenshotType screenshotType )
3636 {
37- // Make sure we only intend to add the new screenshot to the user's XML formatted settings.
38- if ( screenshotType == ScreenshotType . User )
37+ try
3938 {
40- XmlNode xScreenshots = xDoc . GetElementsByTagName ( XML_FILE_SCREENSHOTS_NODE ) . Item ( 0 ) ;
39+ // Make sure we only intend to add the new screenshot to the user's XML formatted settings.
40+ if ( screenshotType == ScreenshotType . User )
41+ {
42+ XmlNode xScreenshots = xDoc . GetElementsByTagName ( XML_FILE_SCREENSHOTS_NODE ) . Item ( 0 ) ;
4143
42- XmlElement xNewScreenshot = xDoc . CreateElement ( XML_FILE_SCREENSHOT_NODE ) ;
44+ XmlElement xNewScreenshot = xDoc . CreateElement ( XML_FILE_SCREENSHOT_NODE ) ;
4345
44- XmlElement xNewScreenshotIndex = xDoc . CreateElement ( SCREENSHOT_INDEX ) ;
45- xNewScreenshotIndex . InnerText = newScreenshot . Index . ToString ( ) ;
46+ XmlElement xNewScreenshotIndex = xDoc . CreateElement ( SCREENSHOT_INDEX ) ;
47+ xNewScreenshotIndex . InnerText = newScreenshot . Index . ToString ( ) ;
4648
47- XmlElement xNewScreenshotDate = xDoc . CreateElement ( SCREENSHOT_DATE ) ;
48- xNewScreenshotDate . InnerText = newScreenshot . Date ;
49+ XmlElement xNewScreenshotDate = xDoc . CreateElement ( SCREENSHOT_DATE ) ;
50+ xNewScreenshotDate . InnerText = newScreenshot . Date ;
4951
50- XmlElement xNewScreenshotPath = xDoc . CreateElement ( SCREENSHOT_PATH ) ;
51- xNewScreenshotPath . InnerText = newScreenshot . Path ;
52+ XmlElement xNewScreenshotPath = xDoc . CreateElement ( SCREENSHOT_PATH ) ;
53+ xNewScreenshotPath . InnerText = newScreenshot . Path ;
5254
53- XmlElement xNewScreenshotScreen = xDoc . CreateElement ( SCREENSHOT_SCREEN ) ;
54- xNewScreenshotScreen . InnerText = newScreenshot . Screen . ToString ( ) ;
55+ XmlElement xNewScreenshotScreen = xDoc . CreateElement ( SCREENSHOT_SCREEN ) ;
56+ xNewScreenshotScreen . InnerText = newScreenshot . Screen . ToString ( ) ;
5557
56- XmlElement xNewScreenshotFormat = xDoc . CreateElement ( SCREENSHOT_FORMAT ) ;
57- xNewScreenshotFormat . InnerText = newScreenshot . Format ;
58+ XmlElement xNewScreenshotFormat = xDoc . CreateElement ( SCREENSHOT_FORMAT ) ;
59+ xNewScreenshotFormat . InnerText = newScreenshot . Format ;
5860
59- XmlElement xNewScreenshotFilename = xDoc . CreateElement ( SCREENSHOT_FILENAME ) ;
60- xNewScreenshotFilename . InnerText = newScreenshot . Filename ;
61+ XmlElement xNewScreenshotFilename = xDoc . CreateElement ( SCREENSHOT_FILENAME ) ;
62+ xNewScreenshotFilename . InnerText = newScreenshot . Filename ;
6163
62- XmlElement xNewScreenshotSlidename = xDoc . CreateElement ( SCREENSHOT_SLIDENAME ) ;
63- xNewScreenshotSlidename . InnerText = newScreenshot . Slidename ;
64+ XmlElement xNewScreenshotSlidename = xDoc . CreateElement ( SCREENSHOT_SLIDENAME ) ;
65+ xNewScreenshotSlidename . InnerText = newScreenshot . Slidename ;
6466
65- // Append all the nodes in the appropriate locations.
66- xNewScreenshot . AppendChild ( xNewScreenshotIndex ) ;
67- xNewScreenshot . AppendChild ( xNewScreenshotDate ) ;
68- xNewScreenshot . AppendChild ( xNewScreenshotPath ) ;
69- xNewScreenshot . AppendChild ( xNewScreenshotScreen ) ;
70- xNewScreenshot . AppendChild ( xNewScreenshotFormat ) ;
71- xNewScreenshot . AppendChild ( xNewScreenshotFilename ) ;
72- xNewScreenshot . AppendChild ( xNewScreenshotSlidename ) ;
73- xScreenshots . AppendChild ( xNewScreenshot ) ;
67+ // Append all the nodes in the appropriate locations.
68+ xNewScreenshot . AppendChild ( xNewScreenshotIndex ) ;
69+ xNewScreenshot . AppendChild ( xNewScreenshotDate ) ;
70+ xNewScreenshot . AppendChild ( xNewScreenshotPath ) ;
71+ xNewScreenshot . AppendChild ( xNewScreenshotScreen ) ;
72+ xNewScreenshot . AppendChild ( xNewScreenshotFormat ) ;
73+ xNewScreenshot . AppendChild ( xNewScreenshotFilename ) ;
74+ xNewScreenshot . AppendChild ( xNewScreenshotSlidename ) ;
75+ xScreenshots . AppendChild ( xNewScreenshot ) ;
7476
75- // Add the new screenshot to the collection of screenshots.
76- _screenshotList . Add ( newScreenshot ) ;
77+ // Add the new screenshot to the collection of screenshots.
78+ _screenshotList . Add ( newScreenshot ) ;
79+ }
80+ }
81+ catch ( Exception ex )
82+ {
83+ Log . Write ( "ScreenshotCollection::Add" , ex ) ;
7784 }
7885 }
7986
0 commit comments