C# 使用C语言中的API设置Google日历事件的颜色#
我有一个关于使用C#的Google日历API的问题。我想设置特定事件的颜色,但无论我向ColorId属性添加什么,它都不会影响更新后的事件 这是我的密码:C# 使用C语言中的API设置Google日历事件的颜色#,c#,asp.net,.net-core,google-calendar-api,C#,Asp.net,.net Core,Google Calendar Api,我有一个关于使用C#的Google日历API的问题。我想设置特定事件的颜色,但无论我向ColorId属性添加什么,它都不会影响更新后的事件 这是我的密码: Event data = CalendarService.Events.Get("primary", id).Execute(); data.Description = _GetDescription(done, notes, uniqueLinkId); Colors colors = CalendarService.Colors.
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();
你知道这是怎么回事吗
问候,,
Andreas看起来可能是个bug 唯一的问题是,我也无法使用谷歌API exporer设置它。这让我想知道,这是否是他们在新谷歌日历发布后删除的东西
我已经向谷歌发送了一封电子邮件,但我没有与该团队的直接联系。我需要一段时间才能听到任何消息。检查数据它现在的颜色id是什么?你想把它设成什么颜色?你可能想看看补丁方法,顺便说一句,@DaImTo数据的颜色id是“4”,我想把它设置为“8”。你说的贴片法是什么意思?谢谢,AndreasI甚至没有把它拿回来,就像colorid总是返回null一样。当我在更新后获取事件时,colorid是“8”。这是正确的。但当我查看我的谷歌日历时,事件的颜色仍然与更新前相同。有什么想法吗?谢谢你的努力。如果您有任何答复,我期待着您的回复:)