-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathMainService.cs
More file actions
29 lines (25 loc) · 781 Bytes
/
MainService.cs
File metadata and controls
29 lines (25 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.IO;
using System.Reflection;
namespace Algoloop.Wpf.Model
{
public static class MainService
{
public static string GetProgramFolder()
{
string unc = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(unc) ?? string.Empty;
}
public static string GetProgramDataFolder()
{
string programDataFolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
AboutModel.Product);
if (!Directory.Exists(programDataFolder))
{
Directory.CreateDirectory(programDataFolder);
}
return programDataFolder;
}
}
}