Getting “Show me” Available/busy value in Google (

2020-04-08 05:12发布

Does anyone know how do get the "show me" value using Google .NET API? I know how to get mosts of the EventEntry details I just cant get this one out.

it is the one highlighted on the image below

enter image description here

2条回答
姐就是有狂的资本
2楼-- · 2020-04-08 06:00

I did a direct request to the calendar atom feed after changing that value for an event to see what element changed in the event xml and it looks like it is the Transparency element. Looking at the source for the .net google data api client library shows that it is accessible through the EventEntry.EventTransparency property.

查看更多
等我变得足够好
3楼-- · 2020-04-08 06:03

I created an extension method that handles this:

/// <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");
}

Usage:

EventEntry eventEntry = ... 
bool isBusy = eventEntry.IsBusy();
查看更多
登录 后发表回答