示例#1
0
        private static async Task <ChangedObject> GenerateCalendar(Userconfig config)
        {
            var events = config.config.events.Distinct().ToArray();
            var file   = GetCalendarFileOfUser(config);

            return(await GenerateCalendar(config.chat.first_name, file, events, config.config.changes, config.config.removedEvents));
        }
示例#2
0
        private static FileInfo GetCalendarFileOfUser(Userconfig config)
        {
            var filename = config.chat.id.ToString();

            if (!string.IsNullOrWhiteSpace(config.config.calendarfileSuffix))
            {
                filename += "-" + config.config.calendarfileSuffix;
            }
            var file = FilesystemHelper.GenerateFileInfo(CALENDAR_DIRECTORY, filename, ".ics");

            return(file);
        }