public App()
        {
            var dir  = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Jobs");
            var dir2 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Output");

            DirFileHelper.CreateDir(dir);
            DirFileHelper.CreateDir(dir2);
        }
Beispiel #2
0
        public static void SaveObjectLocal <T>(T source) where T : class
        {
            var basePath = CommonHelper.ExePath;
            var dirPath  = Path.Combine(basePath, "LocalData");

            DirFileHelper.CreateDir(dirPath);
            var serializedstr = JsonConvert.SerializeObject(source);
            var fileName      = string.Format("local_{0}.json", typeof(T).ToString());
            var filePath      = Path.Combine(dirPath, fileName);

            DirFileHelper.CreateFile(filePath, serializedstr);
        }
Beispiel #3
0
        public App()
        {
            var dir    = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Jobs");
            var dir2   = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Output");
            var dirLog = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");

            App.Current.Startup += Current_Startup;
            App.Current.Exit    += Current_Exit;
            DirFileHelper.CreateDir(dir);
            DirFileHelper.CreateDir(dir2);
            DirFileHelper.CreateDir(dirLog);
        }
Beispiel #4
0
        public static void InitLocalPath()
        {
            var basePath = CommonHelper.ExePath;
            var dirPath  = Path.Combine(basePath, "LocalData");

            if (DirFileHelper.IsExistDirectory(dirPath))
            {
                DirFileHelper.ClearDirectory(dirPath);
            }
            else
            {
                DirFileHelper.CreateDir(dirPath);
            }
        }