没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:龚雪|2023-07-26 10:54:11.207|阅读 110 次
概述:本文将介绍在使用DevExpress WinForms Scheduler组件时如何实现与Office 365的双向同步,欢迎下载相关组件体验!
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
随着DevExpress WinForms最近的更新,用户可以无缝同步DevExpress WinForms Scheduler与Office 365事件/日程的数据。您可以将用户日程从WinForms Scheduler中导出到Office 365日历,或将Office 365事件/日程导入到Scheduler控件。在同步钱修改用户事件/日程,将用户日程与Microsoft 365日历合并,解决合并冲突,并将更改保存到数据库中。
DevExpress WinForms 拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!
DevExpress技术交流群8:523159565 欢迎一起进群讨论
安装以下依赖库(NuGet包):
将WinForms Scheduler控件放到窗体上,打开其智能标签菜单并选择"Sync with Microsoft 365 Calendar",这将创建DXOutlook365Sync组件。
如果您需要在应用程序和Microsoft Office 365日历同步之后保存对数据库的更改,DXOutlook365Sync组件需要五个特定字段(在您的数据源中)来存储Microsoft 365事件的唯一标识符并记录用户事件/约会的最后修改日期。
DataTable source = new DataTable();
source.Columns.AddRange(new DataColumn[] {
new DataColumn("Subject", typeof(string)),
new DataColumn("Description", typeof(string)),
new DataColumn("Start", typeof(DateTime)),
new DataColumn("End", typeof(DateTime)),
// Special data fields.
new DataColumn("Outlook365CalendarId", typeof(string)),
new DataColumn("Outlook365EventId", typeof(string)),
new DataColumn("Outlook365EventUniqId", typeof(string)),
new DataColumn("Outlook365LastChangedUTC", typeof(DateTime)),
new DataColumn("SchedulerLastChangedUTC", typeof(DateTime))
});
定义到这些字段的自定义映射,来完成数据源设置。
// Defines custom mappings.
schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("outlook365_calendar_id", "Outlook365CalendarId"));
schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("outlook365_event_id", "Outlook365EventId"));
schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("outlook365_event_ICalUId", "Outlook365EventUniqId"));
schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("outlook365_lastChangedUTC", "Outlook365LastChangedUTC"));
schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("scheduler_lastChangedUTC", "SchedulerLastChangedUTC"));
在使用DXOutlook365Sync组件的API之前,必须初始化它,使用它的InitAsync()方法,此方法打开"Sign in to your account"窗口(需要登录Microsoft Office 365)。
private async void initBarButtonItem_ItemClick(object sender, ItemClickEventArgs e) {
await dxOutlook365Sync1.InitAsync();
}
DXOutlook365Sync组件可以将WinForms Scheduler控件中的用户日程与所有(或特定)Office 365日历中的事件同步,它的日历集合包含与Office365日历对应的OutlookCalendarItem对象。
日历具有OutlookCalendarItem.EnableSynchronization设置,该设置指定是否将其事件与WinForms Scheduler控件中的用户日程同步。
使用ImportOutlookToSchedulerAsync(Boolean)方法将Office 365日历中的事件导入到WinForms Scheduler控件中。
using DevExpress.XtraScheduler.Microsoft365Calendar;
private async void importEventsButton_Click(object sender, EventArgs e) {
// Checks whether the initialization of 'dxOutlook365Sync1' failed.
if(!await InitOutlook365Sync(dxOutlook365Sync1)) return;
// Displays the wait form.
splashScreenManager1.ShowWaitForm();
// Imports Outlook 365 events to the Scheduler control.
await dxOutlook365Sync1.ImportOutlookToSchedulerAsync(false);
// Hides the wait form.
splashScreenManager1.CloseWaitForm();
}
private async Task<bool> InitOutlook365Sync(DXOutlook365Sync outlook365sync) {
// Initializes the 'dxOutlook365Sync1' component.
InitStatus status = await outlook365sync.InitAsync();
// Returns false and displays a message box if the initialization of 'dxOutlook365Sync1' failed.
if(status == InitStatus.Error) {
XtraMessageBox.Show("Initialization of DXOutlook365Sync failed.", "Error", MessageBoxButtons.OK);
return false;
}
return true;
}
使用ExportSchedulerToOutlookAsync(Boolean)方法从DevExpress Scheduler控件导出用户日程到Office 365日历。
以下事件允许您在同步之前自定义用户日程或事件:
DXOutlook365Sync API允许您将用户日程与Office 365事件合并,您可以合并所有事件/日程,也可以定义跳过某些事件/日程的规则(基于特定条件)。
同步API允许您根据需要轻松解决合并冲突。
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@ke049m.cn
文章转载自:慧都网



注意: Cogent DataHub 软件 v11 包含一些新功能,您的目标操作系统可能不支持这些功能。
本教程主要为大家介绍如何使用DevExpress WinForms数据网格控件进行数据排序的基础知识,欢迎下载最新版组件体验!
在使用Parasoft C/C++test执行BugDetective数据流分析时,可能会遇到用户自定义的资源API,那在这种情况下,若要判断是否存在资源问题,如资源泄露等,则需要手动配置测试配置。
大型SaaS系统的自动化测试常常受制于界面变化快、结构复杂、加载机制多变等因素。从元素识别到脚本管理,SmartBear TestComplete帮助Salesforce建了可靠的自动化测试体系。
相关产品
优秀的界面控件开发包,帮助企业构建卓越应用!
DevExpress DXperience Subscription高性价比的企业级.NET用户界面套包,助力企业创建卓越应用!
DevExpress WinForms Subscription为Windows Forms平台创建具有影响力的业务解决方案,高性价比WinForms界面控件套包。
最新文章 MORE
半岛外围网上直营相关的文章 MORE
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@ke049m.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
半岛外围网上直营 