diff options
| author | MichaelTheShifter <[email protected]> | 2016-05-25 20:50:35 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-05-25 20:50:35 -0400 |
| commit | c43d82eebd5e71ff5860fb2797bc4ebaa90e541e (patch) | |
| tree | 89ded82085a904e10a503f3c4454d1ed140fa996 /source/WindowsFormsApplication1/skins.cs | |
| parent | e2d2829ce94c81ad5c36e0fc59cac63438520d67 (diff) | |
| download | shiftos-c-_theultimatehacker-c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.tar.gz shiftos-c-_theultimatehacker-c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.tar.bz2 shiftos-c-_theultimatehacker-c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.zip | |
Release Candidate 2
We're almost there...
Diffstat (limited to 'source/WindowsFormsApplication1/skins.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/skins.cs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source/WindowsFormsApplication1/skins.cs b/source/WindowsFormsApplication1/skins.cs index bfef221..0393a47 100644 --- a/source/WindowsFormsApplication1/skins.cs +++ b/source/WindowsFormsApplication1/skins.cs @@ -463,18 +463,24 @@ namespace Skinning public static void SavePanels() { string dir = Paths.LoadedSkin + "panels"; - if(Directory.Exists(dir)) + if (!Directory.Exists(dir)) { - Directory.Delete(dir, true); + Directory.CreateDirectory(dir); } - Directory.CreateDirectory(dir); - foreach(var pnl in loadedSkin.DesktopPanels) + foreach (var pnl in loadedSkin.DesktopPanels) { string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString(); - if(pnl.BackgroundImage != null) + if (pnl.BackgroundImage != null) { - pnl.BackgroundImage.Save(dpath); - pnl.BackgroundImage = null; + try + { + pnl.BackgroundImage.Save(dpath); + pnl.BackgroundImage = null; + } + catch + { + pnl.BackgroundImage = null; + } } } } |
