clean up
This commit is contained in:
29
controller/helper/ConfigFile.cs
Normal file
29
controller/helper/ConfigFile.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeatSaber_Versions.controller.helper
|
||||
{
|
||||
internal class ConfigFile
|
||||
{
|
||||
static public bool isConfigFileThere(string path)
|
||||
{
|
||||
return File.Exists(path);
|
||||
}
|
||||
static public VersionConfigDict createEmptyConfig()
|
||||
{
|
||||
VersionConfig tmp = new VersionConfig();
|
||||
VersionConfigDict conf = new VersionConfigDict();
|
||||
|
||||
tmp.name = "Example";
|
||||
tmp.path = "C:\\Steam\\Beat Saber";
|
||||
tmp.version = "1.21.0";
|
||||
conf.versions = new Dictionary<string, VersionConfig>();
|
||||
conf.versions.Add(tmp.version, tmp);
|
||||
|
||||
return conf;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
controller/helper/staticHelpers.cs
Normal file
25
controller/helper/staticHelpers.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeatSaber_Versions.controller.helper
|
||||
{
|
||||
internal class staticHelpers
|
||||
{
|
||||
static public bool IsSymbolic(string path)
|
||||
{
|
||||
FileInfo pathInfo = new FileInfo(path);
|
||||
return pathInfo.Attributes.HasFlag(FileAttributes.ReparsePoint);
|
||||
}
|
||||
static public bool IsElevated
|
||||
{
|
||||
get
|
||||
{
|
||||
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user