Exemple #1
0
 public RuntimeFile ReadRuntimeFile(JToken json)
 {
     var file = new RuntimeFile();
     foreach (var runtimeSpec in EachProperty(json["runtimes"]).Select(ReadRuntimeSpec))
     {
         file.Runtimes.Add(runtimeSpec.Name, runtimeSpec);
     }
     return file;
 }
        private void WriteRuntimeFile(JObject json, RuntimeFile runtimeFile)
        {
            var runtimes = new JObject();

            json["runtimes"] = runtimes;
            foreach (var x in runtimeFile.Runtimes.Values)
            {
                WriteRuntimeSpec(runtimes, x);
            }
        }
        public RuntimeFile ReadRuntimeFile(JToken json)
        {
            var file = new RuntimeFile();

            foreach (var runtimeSpec in EachProperty(json["runtimes"]).Select(ReadRuntimeSpec))
            {
                file.Runtimes.Add(runtimeSpec.Name, runtimeSpec);
            }
            return(file);
        }
 public void WriteRuntimeFile(string filePath, RuntimeFile runtimeFile)
 {
     using (var fileStream = new FileStream(filePath, FileMode.Create))
     {
         using (var textWriter = new StreamWriter(fileStream))
         {
             using (var jsonWriter = new JsonTextWriter(textWriter))
             {
                 jsonWriter.Formatting = Formatting.Indented;
                 var json = new JObject();
                 WriteRuntimeFile(json, runtimeFile);
                 json.WriteTo(jsonWriter);
             }
         }
     }
 }
Exemple #5
0
 public void WriteRuntimeFile(string filePath, RuntimeFile runtimeFile)
 {
     using (var fileStream = new FileStream(filePath, FileMode.Create))
     {
         using (var textWriter = new StreamWriter(fileStream))
         {
             using (var jsonWriter = new JsonTextWriter(textWriter))
             {
                 jsonWriter.Formatting = Formatting.Indented;
                 var json = new JObject();
                 WriteRuntimeFile(json, runtimeFile);
                 json.WriteTo(jsonWriter);
             }
         }
     }
 }
Exemple #6
0
 private void WriteRuntimeFile(JObject json, RuntimeFile runtimeFile)
 {
     var runtimes = new JObject();
     json["runtimes"] = runtimes;
     foreach(var x in runtimeFile.Runtimes.Values)
     {
         WriteRuntimeSpec(runtimes, x);
     }
 }