Exemple #1
0
        internal string Save(string filename, bool inNewFile)
        {
            if (inNewFile)
            {
                var        di     = new DirectoryInfo(Environment.CurrentDirectory);
                FileInfo[] fls    = di.GetFiles(filename + Form1.FileExt);
                string     suffix = "+";
                while (fls.Any())
                {
                    filename = filename + suffix;
                    fls      = di.GetFiles(filename + Form1.FileExt);
                }
            }

            List <SCellInfo> cells = _cells.Select(c => c.Value.GetCellInfo()).ToList();

            JsonToFile <List <SCellInfo> > .Save(Environment.CurrentDirectory, filename + Form1.FileExt, cells);

            _owner.AddLogToConsole($"{filename} was saved", ELogLevel.IMPORTANT_INFO);

            return(filename);
        }