Esempio n. 1
0
        /// <summary>
        /// Write the receipt to disk.
        /// </summary>
        /// <param name="Location">Output filename</param>
        public void WriteIfModified(FileReference Location)
        {
            DirectoryReference BaseDir = Location.Directory;

            MemoryStream MemoryStream = new MemoryStream();

            using (JsonWriter Writer = new JsonWriter(new StreamWriter(MemoryStream)))
            {
                Writer.WriteObjectStart();

                string[] OutputFileStrings = new string[OutputFiles.Count];
                for (int Idx = 0; Idx < OutputFiles.Count; Idx++)
                {
                    OutputFileStrings[Idx] = OutputFiles[Idx].MakeRelativeTo(BaseDir);
                }
                Writer.WriteStringArrayField("OutputFiles", OutputFileStrings);

                Writer.WriteObjectEnd();
            }

            FileReference.WriteAllBytesIfDifferent(Location, MemoryStream.ToArray());
        }