Created
March 18, 2019 10:59
-
-
Save pczajkowski/ce2238b9f2598a026fffe4e4d80f6254 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string AppName | |
{ | |
get | |
{ | |
if (!string.IsNullOrEmpty(_appName)) | |
return _appName; | |
var name = System.Diagnostics.Process.GetCurrentProcess().ProcessName; | |
if (string.IsNullOrEmpty(name)) | |
throw new Exception("Can't establish app name!"); | |
_appName = name; | |
return name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment