示例#1
0
        //  public static string CreatedFilePath { get; set; } = "../../json/created.json";
        public static string CreateJSON(MandelbrotJSON mandelbrotJSON, string createdFilePath)
        {
            string directory = Directory.GetCurrentDirectory();

            string jsonString = JsonSerializer.Serialize(mandelbrotJSON);

            File.WriteAllText(createdFilePath, jsonString);

            return(jsonString);
        }
示例#2
0
        private string CreateMandelbrotRequestObject(string createdFilePath)
        {
            MandelbrotJSON mandelbrotJSON = new MandelbrotJSON()
            {
                Center        = center,
                Zoom          = zoom,
                HeightPixel   = HeightPixel,
                WidthPixel    = WidthPixel,
                MaxIterations = maxIterations
            };

            return(ConverterJSON.CreateJSON(mandelbrotJSON, createdFilePath));
        }
示例#3
0
 public static string WriteFromObject(MandelbrotJSON mandelbrotJSON)
 {
     return(JsonSerializer.Serialize(mandelbrotJSON));
 }