Appointment
内容
[
隐藏
]Appointment class
表示电子邮件的日历。
public class Appointment
构造函数
| 姓名 | 描述 |
|---|---|
| Appointment(string, DateTime, DateTime, MailAddress, MailAddressCollection) | 初始化一个新的实例Appointment类. |
| Appointment(string, string, string, DateTime, DateTime, MailAddress, MailAddressCollection) | 初始化一个新的实例Appointment类. |
| Appointment(string, string, string, DateTime, DateTime, MailAddress, MailAddressCollection, RecurrencePattern) | 初始化一个新的实例Appointment类. |
| Appointment(string, string, string, DateTime, DateTime, MailAddress, MailAddressCollection, string) | 初始化一个新的实例Appointment类. |
| Appointment(string, string, string, DateTime, DateTime, MailAddress, MailAddressCollection, string, RecurrencePattern) | 初始化一个新的实例Appointment类. |
特性
| 姓名 | 描述 |
|---|---|
| Attachments { get; } | 获取约会的附件集合。 |
| Attendees { get; set; } | 获取或设置参加者。 |
| Class { get; set; } | 指定约会的访问分类。 |
| CreatedDate { get; set; } | 获取或设置日历信息创建的日期和时间。 |
| DateTimeStamp { get; set; } | 获取或设置创建 iCalendar 对象实例的日期/时间.. |
| Description { get; set; } | 获取或设置描述。 |
| EndDate { get; set; } | 获取或设置结束日期。 |
| EndTimeZone { get; set; } | 结束时区 |
| Flags { get; set; } | 获取或设置约会标志。 |
| HtmlDescription { get; set; } | 获取或设置描述的 html 表示。 |
| LastModifiedDate { get; set; } | 获取或设置上次修改日历信息的日期和时间。 |
| Location { get; set; } | 获取或设置位置。 |
| MethodType { get; set; } | 获取或设置与日历对象 关联的iCalendar 对象方法类型。 |
| MicrosoftBusyStatus { get; set; } | 指定约会的忙碌状态。 |
| MicrosoftImportance { get; set; } | 指定约会的重要性。 |
| MicrosoftIntendedStatus { get; set; } | 指定约会的 INTENDED 状态。 |
| OptionalAttendees { get; } | 获取可选的与会者。 |
| Organizer { get; set; } | 获取或设置组织者。 |
| Recurrence { get; set; } | 获取或设置重复模式。 |
| Reminders { get; } | 包含 AppointmentReminder 的集合AppointmentReminder对象. |
| SequenceId { get; } | 获取序列id。 |
| StartDate { get; set; } | 获取或设置开始日期。 |
| StartTimeZone { get; set; } | 开始时区 |
| Status { get; set; } | 获取或设置对象的整体状态或确认。 |
| Summary { get; set; } | 获取或设置摘要。 |
| Transparency { get; set; } | 指定此约会是否打算在可用性搜索中可见。 |
| UniqueId { get; set; } | 获取或设置包含日历项的 GUID 的字符串值。 在 MS Exchange 中,这是 PidLidGlobalObjectId mapi 属性。 |
方法
| 姓名 | 描述 |
|---|---|
| static Load(Stream) | 加载Appointment来自stream |
| static Load(string) | 加载Appointment来自文件. 支持的文件格式:iCalendar |
| static Load(Stream, AppointmentLoadOptions) | 加载Appointment来自stream |
| static Load(Stream, bool) | 加载Appointment来自stream |
| static Load(string, AppointmentLoadOptions) | 加载Appointment来自文件. 支持的文件格式:iCalendar 一个文件路径。代表约会负载选项AppointmentLoadOptions.一读Appointment. |
| CancelAppointment() | 取消约会。 |
| CancelAppointment(int) | 取消约会。 |
| GetAppointmentHtml() | 获取日历 HTML。 |
| GetAppointmentText() | 获取日历文本。 |
| GetAppointmentText(AppointmentFormattingOptions) | 获取日历文本。 |
| RequestApointment() | 请求预约。 |
| RequestApointment(int) | 请求预约。 |
| ResetTimeZone() | 设置本地时区 |
| Save(Stream) | 使用默认保存选项将约会保存到 iCalendar 格式的文件 |
| Save(string) | 使用默认保存选项将约会保存到 iCalendar 格式的文件 |
| Save(Stream, AppointmentSaveFormat) | 使用默认保存选项以指定格式将约会保存到流中 |
| Save(Stream, AppointmentSaveOptions) | 使用指定的保存选项将约会保存到流 |
| Save(string, AppointmentSaveFormat) | 使用默认保存选项将约会保存到指定格式的文件 |
| Save(string, AppointmentSaveOptions) | 使用指定的保存选项将约会保存到文件 |
| SetTimeZone(string) | 设置时区 |
| UpdateAppointment() | 更新约会。 |
| UpdateAppointment(int) | 更新约会。 |
例子
此示例演示如何将日历添加到电子邮件中。
[C#]
[视觉基础]
MailMessage msg = new MailMessage();
//参加活动的人
MailAddressCollection attendees = new MailAddressCollection();
attendees.Add(new MailAddress("person1@domain.com"));
attendees.Add(new MailAddress("person2@domain.com"));
attendees.Add(new MailAddress("person3@domain.com"));
//创建约会
Appointment app = new Appointment("Room 112",new DateTime(2006,7,17,13,0,0),new DateTime(2006,7,17,14,0,0),new MailAddress("somebody@domain.com"), attendees );
cal.Summary = "Release Meetting";
cal.Description = "Discuss for the next release";
//给消息添加日历
msg.AddAlternateView(app.RequestApointment());
//发送电子邮件
SmtpClient smtp= new SmtpClient("smtp.server.com", 25, "user", "password");
smtp.Send(msg);
Dim msg As MailMessage = New MailMessage()
'参加活动的人
Dim attendees As MailAddressCollection = New MailAddressCollection()
attendees.Add(New MailAddress("person1@domain.com"))
attendees.Add(New MailAddress("person2@domain.com"))
attendees.Add(New MailAddress("person3@domain.com"))
'创建日历
Dim cal As Appointment = New Appointment("Room 112",New DateTime(2006,7,17,13,0,0),New DateTime(2006,7,17,14,0,0),New MailAddress("somebody@domain.com"),attendees)
cal.Summary = "Release Meetting"
cal.Description = "Discuss for the next release"
'在邮件中添加日历
msg.AddAlternateView(app.RequestApointment())