예제 #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;
 }
예제 #2
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);
            }
        }
예제 #3
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);
        }
예제 #4
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);
             }
         }
     }
 }
예제 #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);
             }
         }
     }
 }
예제 #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);
     }
 }