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

2020-04-08 05:54发布

问题:

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

回答1:

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.



回答2:

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();