예제 #1
0
        public static string GetRulesPath(string rulesFileName)
        {
            string appData = Const.GetAppDataFolderPath();

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

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

            return(Path.Combine(appData, SnapshotInstancesFileName));
        }
예제 #5
0
        //
        // Path computing methods

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

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