コード例 #1
0
ファイル: RuntimeFormatter.cs プロジェクト: noahfalk/dnx
 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
ファイル: RuntimeFormatter.cs プロジェクト: noahfalk/dnx
 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
ファイル: RuntimeFormatter.cs プロジェクト: noahfalk/dnx
 private void WriteRuntimeFile(JObject json, RuntimeFile runtimeFile)
 {
     var runtimes = new JObject();
     json["runtimes"] = runtimes;
     foreach(var x in runtimeFile.Runtimes.Values)
     {
         WriteRuntimeSpec(runtimes, x);
     }
 }