创建一个使用谷歌日历API全天事件 [英] Create an all-day event using Google Calendar API

查看:279
本文介绍了创建一个使用谷歌日历API全天事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫正与C#和谷歌日历API类CalendarService和事件。 我想上传一个事件,谷歌日历,没有任何日期(全天)。 如果我不设置Event.End财产,我得到一个例外。

Iam working with C# and the Google Calendar API classes "CalendarService" and "Event". I want to upload an event to Google Calendar without any date (all-day). If i don't set the Event.End property, I get an exception.

如何设置我的事件作为一个全天事件?

How can I set my event as an all-day event ?

我已经搜索了半天,没有任何解决方案...

I've searched for a long time, without any solution...

推荐答案

添加一个新的时间与 AllDay 设置为true:

Add a new time with AllDay set to true:

var entry = new EventEntry(title, description, "");
var time = new When();
time.StartTime = start;
time.AllDay = true;

entry.Times.Add(time);

这篇关于创建一个使用谷歌日历API全天事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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