在Google(日历活动).Net API中获取“显示我”可用/忙碌值

时间:2011-06-14 01:57:07

标签: c# .net vb.net google-calendar-api

有谁知道如何使用Google .NET API获取“show me”值?我知道如何获得大部分的EventEntry细节我只是不能把它拿出来。

是下图中突出显示的那个

enter image description here

2 个答案:

答案 0 :(得分:4)

我在更改事件的值之后直接请求日历原子提要,以查看事件xml中更改了哪个元素,看起来它是透明度元素。查看.net google data api客户端库的源代码,可以看到它可以通过EventEntry.EventTransparency属性访问。

答案 1 :(得分:1)

我创建了一个处理此问题的扩展方法:

/// <summary>
/// Determines whether or not the EventEntry is set as Busy.
/// </summary>
/// <param name="entry">The Google EventEntry.</param>
public static bool IsBusy(this EventEntry entry)
{
    return entry.EventTransparency.Value.Equals("http://schemas.google.com/g/2005#event.opaque");
}

用法:

EventEntry eventEntry = ... 
bool isBusy = eventEntry.IsBusy();
相关问题