如何使用ics文件取消日历事件? [英] How to cancel an calendar event using ics files?

查看:91
本文介绍了如何使用ics文件取消日历事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的要求之一是创建iCalendar文件(.ics),并将每个文件作为附件发送给电子邮件.我们正在使用 DDay.Ical.dll 来创建ics文件,如下所示:

One of our requirements is to create iCalendar files (.ics) and send them each in emails as an attachment. We are using DDay.Ical.dll to create ics files as under:

// Create a new iCalendar
iCalendar iCal = new iCalendar();

// Create the event, and add it to the iCalendar
Event evt = iCal.Create<Event>();

// Set information about the event
evt.Start = new iCalDateTime(SomeStartTime);
evt.End = new iCalDateTime(SomeEndTime);
evt.Location = "At so and so place";
evt.Description = "Some Description";
evt.Summary = "About Some Subject";
iCal.Method = "PUBLISH";

// Serialize (save) the iCalendar
iCalendarSerializer serializer = new iCalendarSerializer();
serializer.Serialize(iCal, @"iCalendar.ics");

完整的过程是:

  1. User1为特定日期和时间创建一个iCal文件,并将其发送给User2.
  2. User2将打开ics文件并接受邀请.约会项目将在User2的LOCAL外观中创建.

现在,假设由于任何原因取消了约会,则User1必须创建一个ics文件并将其发送给User2,以便User2可以从本地前景中取消其活动.

Now, Suppose, because of any reason if appointment is cancelled, then User1 HAS to create an ics file and send it to User2, so that User2 can cancel his event from the local outlook.

如何创建此类ics文件?

How to create such ics file?

推荐答案

文件的创建方式与原始ics文件的创建方式相同.事件状态将有所不同. UID将标识事件,序列号将指示更新的优先级,然后将记录事件详细信息(更改或取消)

File gets created in the same way as the original ics file. The event status will be different. UID will identify the event and sequence number will indicate priority of update, and then the event details will be noted (changes or cancellations)

如果要在发出邀请后更改/取消事件,则需要通过其UID标识事件/约会,并分配比原始ics事件更大的SEQUENCE号.

If you want to change/cancel an event after sending out an invitation, you need to identify the event/appointment by its UID, and allocate a bigger SEQUENCE number than the original ics event.

UID(唯一标识符): http://tools.ietf.org/html/rfc5545#page-117

UID (unique identifier) : http://tools.ietf.org/html/rfc5545#page-117

序列: http://tools.ietf.org/html/rfc5545#page- 138

并设置事件状态

             / "CANCELLED"    ;Indicates event was cancelled.

状态: http://tools.ietf.org/html/rfc5545#page- 92

哦-和方法 如果您需要发送取消事件,则UID应该与原始事件相同,并且组件属性应设置为取消Ex. 方法:取消 状态:已取消

oh - and method If you need to send in a cancellation for an event the UID should be same as the original event and the component properties should be set to cancel Ex. METHOD:CANCEL STATUS:CANCELLED

当然,只有在接收者随后真正单击以将事件加载/订阅到第一次日历应用程序中时,此事件才会取消"该事件. 对于已订阅"了远程ic的应用程序-当它们下次进行更新"时,应检查更新是否已处理并覆盖原始事件.

Of course this will only 'cancel' the event if the recipient then actually clicks to load/subscribe it into the same calendar app as the first time. For applications that have 'subscribed' the the remote ics - when they next do an 'update' check the update should be processed and overwrite the original event.

这篇关于如何使用ics文件取消日历事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆