Пример #1
0
        public void ExportTimetable()
        {
            // This one uses the ShellViewModel
            SaveFileParams.Title = "Export timetable as csv file";
            DataAccess.Library.Models.TimetableMatrixModel matrix = TimetableMatrixDataAccess.ReadTimetableMatrix(SelectedTimetable.Id, true);
            var csv = TimetableMatrixDataAccess.GetCsvData(matrix.Matrix);

            if (csv.Length > 0)
            {
                var fileName = FileIOHelper.GetSaveFileName(SaveFileParams);
                if (fileName.Length > 0)
                {
                    File.WriteAllText(fileName, csv);
                }
            }
        }
Пример #2
0
 public void SaveLog()
 {
     var fileSaveParams = new SaveFileModel
     {
         Title            = "Save log file as csv",
         InitialDirectory = Settings.DataPath
     };
     var outputFile = FileIOHelper.GetSaveFileName(fileSaveParams); if (outputFile.Length > 0)
     {
         var allText = LogEntryClass.WriteCsvHeaderLine();
         foreach (var X in LogCollectionManager.LogEvents)
         {
             allText += X.WriteAsCsv();
         }
         File.WriteAllText(outputFile, allText);
     }
 }