コード例 #1
0
        public static void RemoveTokenFromCredentials(string filename)
        {
            var credential = FileSystemHelpers.LoadJson(filename);

            credential["token"] = "";
            File.Delete(filename);
            FileSystemHelpers.DumpJson(filename, credential);
        }
コード例 #2
0
 private static void SetLastExecuted(DateTime now)
 {
     //TODO: use proper c# serialization
     try {
         var emailTimestamp = FileSystemHelpers.LoadJson(reportPath);
         emailTimestamp["last_executed"] = now;
         FileSystemHelpers.DumpJson(reportPath, emailTimestamp);
     } catch (Exception) {
         using (StreamWriter file = File.CreateText(reportPath)) {
             JsonSerializer serialize = new JsonSerializer();
             serialize.Serialize(file, JObject.Parse("{\"last_executed\" :\"" + now + "\"}"));
         }
     }
 }
コード例 #3
0
ファイル: JobConfiguration.cs プロジェクト: Riadhoq/aurelia
 public static void DumpConfiguration(JobConfiguration configuration, string filename)
 {
     FileSystemHelpers.DumpJson(filename, JObject.Parse(configuration.ToString()));
 }