コード例 #1
0
        /// <summary>
        /// Stores the data. If the needed files do not exist they will be created.
        /// </summary>
        public void WriteData()
        {
            var myfolders = @$"{Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)}\A3Faming\CSV\";
            Directory.CreateDirectory(myfolders);

            var file = "Items.csv";
            WriteHelper(myfolders + file, Items.ConvertAll(item => (IToStringArray)item));

            file = "Vehicles.csv";
            WriteHelper(myfolders + file, Vehicles.ConvertAll(vehicle => (IToStringArray)vehicle));

            file = "Routes.csv";
            WriteHelper(myfolders + file, Routes.ConvertAll(route => (IToStringArray)route));
        }