Ejemplo n.º 1
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);
     }
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 6
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);
             }
         }
     }
 }