Skip to content

Commit

Permalink
Merge pull request wokhan#18 from tgp1994/master
Browse files Browse the repository at this point in the history
Enforce solution-wide tabbing standard, pull back icon null check
  • Loading branch information
AtlasHackert authored Sep 13, 2017
2 parents b12451c + d34d61b commit 111accc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# top-most EditorConfig file
root = true

# All code files
[*.{cs,xaml}]
indent_style = space
indent_size = 4
13 changes: 5 additions & 8 deletions Common/Helpers/IconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,12 @@ public class IconHelper
private static BitmapSource GetIconFromPath(string path, bool defaultIfNotFound = false)
{
Icon ic = null;
if (String.IsNullOrEmpty(path))
{
path = "?error";
}
switch (path)
{
case "System":
ic = SystemIcons.WinLogo;
break;

case "?error": //FIXME: Use something else?
ic = SystemIcons.Error;
break;

default:
try
{
Expand Down Expand Up @@ -78,6 +70,11 @@ public static async Task<BitmapSource> GetIconAsync(string path, bool defaultIfN
/// <returns></returns>
public static BitmapSource GetIcon(string path, bool defaultIfNotFound = false)
{
if (String.IsNullOrEmpty(path))
{
path = String.Empty;
}

BitmapSource icon;
if (!procIconLst.ContainsKey(path))
{
Expand Down
5 changes: 5 additions & 0 deletions WindowsFirewallNotifier.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console\Console.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{94028C5E-9B0E-4D15-966A-9FA766A20821}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8868B2A5-29B2-4774-B32D-913A242232BC}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down

0 comments on commit 111accc

Please sign in to comment.