public static string GetRulesPath(string rulesFileName) { string appData = Const.GetAppDataFolderPath(); if (rulesFileName == null) { return(null); } return(Path.Combine(appData, rulesFileName)); }
public static async Task <Tuple <IList <SnapshotRule>, string> > LoadLatestRules() { string appData = Const.GetAppDataFolderPath(); string latestRulesFileName = GetLatestRulesFileName(appData); IList <SnapshotRule> rules = latestRulesFileName == null ? new List <SnapshotRule>() : (await SafeLoadJson <IEnumerable <SnapshotRule> >(Path.Combine(appData, latestRulesFileName))).ToList(); return(new Tuple <IList <SnapshotRule>, string>( rules, latestRulesFileName )); }
public void OnPostInitialize() { try { ConfigMgr.Instance.Initialize(this); HostSnapshotService = new ServiceHost(typeof(SnapshotService)); HostSnapshotService.Open(); } catch (Exception ex) { string err = String.Format(ConfigInitErrorMsg, Const.GetAppDataFolderPath()); Log.Error(ex, err); Log.CloseAndFlush(); throw new Exception(err, ex); } }
public static string GetSnapshotInstancesFilePath() { string appData = Const.GetAppDataFolderPath(); return(Path.Combine(appData, SnapshotInstancesFileName)); }
// // Path computing methods public static string GetAppConfigPath() { string appData = Const.GetAppDataFolderPath(); return(Path.Combine(appData, AppConfigFileName)); }