Rozvrh.Exporters.ImportExport.DownloadAsSVG C# (CSharp) Метод

DownloadAsSVG() публичный Метод

Exports lectures to SVG file.
public DownloadAsSVG ( List lectures, string title, System.DateTime created, string linkToInfo ) : System.Web.Mvc.ActionResult
lectures List List of lectures.
title string Title displayed at top-left corner of the SVG.
created System.DateTime Date the timetable was created from config.
linkToInfo string Hyperlink to webpage with additional information.
Результат System.Web.Mvc.ActionResult
        public ActionResult DownloadAsSVG(List<TimetableField> lectures,string title,DateTime created, string linkToInfo)
        {
            SvgGenerator gen = new SvgGenerator();
            string text = gen.generateSVG(lectures, title, created, linkToInfo);
            byte[] buffer = System.Text.Encoding.UTF8.GetBytes(text);
            var res = new FileContentResult(buffer, "text/plain");
            res.FileDownloadName = "FJFIrozvrh.svg";
            return res;
        }

Usage Example

Пример #1
0
 public ActionResult ExportToSVG()
 {
     ImportExport instance = new ImportExport();
     return instance.DownloadAsSVG(M.CustomTimetableFields, M.SelectedTimetable.m_timetableInfo.TimetableLabel, M.SelectedTimetable.m_timetableInfo.Created,
         M.SelectedTimetable.m_timetableInfo.LinkToAdditionalInformation);
 }