Esempio n. 1
0
        public static string GetRulesPath(string rulesFileName)
        {
            string appData = Const.GetAppDataFolderPath();

            if (rulesFileName == null)
            {
                return(null);
            }

            return(Path.Combine(appData, rulesFileName));
        }
Esempio n. 2
0
        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
                       ));
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        public static string GetSnapshotInstancesFilePath()
        {
            string appData = Const.GetAppDataFolderPath();

            return(Path.Combine(appData, SnapshotInstancesFileName));
        }
Esempio n. 5
0
        //
        // Path computing methods

        public static string GetAppConfigPath()
        {
            string appData = Const.GetAppDataFolderPath();

            return(Path.Combine(appData, AppConfigFileName));
        }