Skip to content

Commit 31e96db

Browse files
committed
Minor code reformat.
1 parent 1cb4e87 commit 31e96db

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/Main/Base/Project/Src/Services/FileIconService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace ICSharpCode.SharpDevelop
1010
{
1111
/// <summary>
12-
/// This Class contains a ResourceManager, which handles bitmap resources
12+
/// This Class handles bitmap resources
1313
/// for the application which were loaded from the filesystem.
1414
/// </summary>
1515
public static class FileIconService
@@ -29,7 +29,7 @@ static void ResourceService_ClearCaches(object sender, EventArgs e)
2929
}
3030

3131
/// <summary>
32-
/// Returns a bitmap from the file system. Paceholders like ${SharpDevelopBinPath}
32+
/// Returns a bitmap from the file system. Placeholders like ${SharpDevelopBinPath}
3333
/// and AddinPath (e. g. ${AddInPath:ICSharpCode.FiletypeRegisterer}) are resolved
3434
/// through the StringParser.
3535
/// The bitmaps are reused, you must not dispose the Bitmap!
@@ -46,11 +46,12 @@ static void ResourceService_ClearCaches(object sender, EventArgs e)
4646
public static Bitmap GetBitmap(string name)
4747
{
4848
Bitmap bmp = null;
49-
if (name.ToUpper().StartsWith("FILE:")) {
49+
if (name.ToUpper().StartsWith("FILE:")) {
5050
lock (bitmapCache) {
5151
if (bitmapCache.TryGetValue(name, out bmp))
5252
return bmp;
53-
bmp = (Bitmap)Image.FromFile(StringParser.Parse(name.Substring(5,name.Length-5)));
53+
string fileName = StringParser.Parse(name.Substring(5, name.Length - 5));
54+
bmp = (Bitmap)Image.FromFile(fileName);
5455
bitmapCache[name] = bmp;
5556
}
5657
}

src/Main/Base/Project/Src/Services/IconService.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ public static Bitmap GetGhostBitmap(Bitmap bitmap)
6161
public static Bitmap GetBitmap(string name)
6262
{
6363
Bitmap bmp = null;
64-
try {
65-
bmp = FileIconService.GetBitmap(name);
66-
if (bmp == null) {
67-
bmp = WinFormsResourceService.GetBitmap(name);
68-
}
69-
} catch (ResourceNotFoundException ex) {
70-
LoggingService.Warn(ex);
71-
} catch (FileNotFoundException ex) {
72-
LoggingService.Warn(ex);
73-
}
74-
if (bmp != null) {
75-
return bmp;
76-
}
77-
return WinFormsResourceService.GetBitmap("Icons.16x16.MiscFiles");
64+
try {
65+
bmp = FileIconService.GetBitmap(name);
66+
if (bmp == null) {
67+
bmp = WinFormsResourceService.GetBitmap(name);
68+
}
69+
} catch (ResourceNotFoundException ex) {
70+
LoggingService.Warn(ex);
71+
} catch (FileNotFoundException ex) {
72+
LoggingService.Warn(ex);
73+
}
74+
if (bmp != null) {
75+
return bmp;
76+
}
77+
return WinFormsResourceService.GetBitmap("Icons.16x16.MiscFiles");
7878
}
7979

8080
public static Icon GetIcon(string name)

0 commit comments

Comments
 (0)