c# - 使用 C# 中的 API 设置 Google 日历事件的颜色
问题描述
我对使用 C# 的 Google Calendar API 有疑问。我想设置特定事件的颜色,但无论我添加到 ColorId 属性中,它都不会在更新后影响我的事件。
这是我的代码:
Event data = CalendarService.Events.Get("primary", id).Execute();
data.Description = _GetDescription(done, notes, uniqueLinkId);
Colors colors = CalendarService.Colors.Get().Execute();
if (colors != null && colors.Calendar != null)
{
var color = colors.Calendar.FirstOrDefault(x => x.Value.Background == "#16a765");
if (!string.IsNullOrWhiteSpace(color.Key))
{
data.ColorId = color.Key;
}
}
var request = CalendarService.Events.Update(data, "primary", id);
request.SupportsAttachments = true;
request.SendNotifications = false;
request.Execute();
关于这如何不起作用的任何想法?
问候, 安德烈亚斯
解决方案
看起来它可能是一个错误CalendarList 背景颜色更改不起作用(.NET)
唯一的问题是我也无法使用 Google APIs exporer 对其进行设置。这让我想知道这是否是他们在新的 Google 日历发布后删除的内容。
我已向 Google 发送了一封电子邮件,但我与该团队没有直接联系,我需要一段时间才能听到任何消息。
推荐阅读
- python - Scipy最小化约束:两个值之一需要为零
- kubernetes - OpenShift,我如何给自己集群管理员?
- python - 奇怪的多处理麻烦
- javascript - 如何在我的网站上显示实时 Firebase 数据?
- c# - 有没有办法从参数的注释中创建 Blazor 组件文档?
- sql - 使用三位列过滤视图
- javascript - GetJSON jquery 返回未定义
- mysql - mysql中不同的最新版本
- c++ - 使用类的链表中的分段错误。我的方法正确吗?
- r - 使用 clm 的 emmeans 对组进行多重比较:UseMethod 中的错误(“vcoc”):没有适用于“vcov”的方法应用于“clm”类的对象