/// <summary> /// <para>Initializes a new instance of the <see cref="GetTeamEventsArg" /> /// class.</para> /// </summary> /// <param name="limit">The maximal number of results to return per call. Note that /// some calls may not return <paramref name="limit" /> number of events, and may even /// return no events, even with `has_more` set to true. In this case, callers should /// fetch again using <see /// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /// />.</param> /// <param name="accountId">Filter the events by account ID. Return only events with /// this account_id as either Actor, Context, or Participants.</param> /// <param name="time">Filter by time range.</param> /// <param name="category">Filter the returned events to a single category. Note that /// category shouldn't be provided together with event_type.</param> /// <param name="eventType">Filter the returned events to a single event type. Note /// that event_type shouldn't be provided together with category.</param> public GetTeamEventsArg(uint limit = 1000, string accountId = null, global::Dropbox.Api.TeamCommon.TimeRange time = null, EventCategory category = null, EventTypeArg eventType = null) { if (limit < 1U) { throw new sys.ArgumentOutOfRangeException("limit", "Value should be greater or equal than 1"); } if (limit > 1000U) { throw new sys.ArgumentOutOfRangeException("limit", "Value should be less of equal than 1000"); } if (accountId != null) { if (accountId.Length < 40) { throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at least 40"); } if (accountId.Length > 40) { throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at most 40"); } } this.Limit = limit; this.AccountId = accountId; this.Time = time; this.Category = category; this.EventType = eventType; }
public void BroadCast(EventTypeArg eventType) { if (!eventDict.ContainsKey(eventType)) { return; } (eventDict[eventType] as Action)?.Invoke(); }
public void BroadCast <T>(EventTypeArg eventType, T arg) { if (!eventDict.ContainsKey(eventType)) { return; } (eventDict[eventType] as Action <T>)?.Invoke(arg); }
public void AddListener <T>(EventTypeArg eventType, Action <T> callBack) { if (eventDict.ContainsKey(eventType)) { eventDict[eventType] = (Action <T>)eventDict[eventType] + callBack; } else { eventDict.Add(eventType, callBack); } }
/// <summary> /// <para>Retrieves team events. If the result's <see /// cref="Dropbox.Api.TeamLog.GetTeamEventsResult.HasMore" /> field is <c>true</c>, /// call <see /// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> with /// the returned cursor to retrieve more entries. If end_time is not specified in your /// request, you may use the returned cursor to poll <see /// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> for /// new events.</para> /// <para>Many attributes note 'may be missing due to historical data gap'.</para> /// <para>Note that the file_operations category and & analogous paper events are not /// available on all Dropbox Business <a href="/business/plans-comparison">plans</a>. /// Use <a /// href="/developers/documentation/http/teams#team-features-get_values">features/get_values</a> /// to check for this feature.</para> /// <para>Permission : Team Auditing.</para> /// </summary> /// <param name="limit">The maximal number of results to return per call. Note that /// some calls may not return <paramref name="limit" /> number of events, and may even /// return no events, even with `has_more` set to true. In this case, callers should /// fetch again using <see /// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /// />.</param> /// <param name="accountId">Filter the events by account ID. Return only events with /// this account_id as either Actor, Context, or Participants.</param> /// <param name="time">Filter by time range.</param> /// <param name="category">Filter the returned events to a single category. Note that /// category shouldn't be provided together with event_type.</param> /// <param name="eventType">Filter the returned events to a single event type. Note /// that event_type shouldn't be provided together with category.</param> /// <returns>The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server.</returns> /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error /// processing the request; This will contain a <see /// cref="GetTeamEventsError"/>.</exception> public t.Task <GetTeamEventsResult> GetEventsAsync(uint limit = 1000, string accountId = null, global::Dropbox.Api.TeamCommon.TimeRange time = null, EventCategory category = null, EventTypeArg eventType = null) { var getTeamEventsArg = new GetTeamEventsArg(limit, accountId, time, category, eventType); return(this.GetEventsAsync(getTeamEventsArg)); }
public void RemoveListener(EventTypeArg eventType, Action callBack) { if (!eventDict.ContainsKey(eventType)) { return; } else { eventDict[eventType] = (Action)eventDict[eventType] - callBack; if (eventDict[eventType] == null) { eventDict.Remove(eventType); } } }
/// <summary> /// <para>Begins an asynchronous send to the get events route.</para> /// </summary> /// <param name="limit">The maximal number of results to return per call. Note that /// some calls may not return <paramref name="limit" /> number of events, and may even /// return no events, even with `has_more` set to true. In this case, callers should /// fetch again using <see /// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /// />.</param> /// <param name="accountId">Filter the events by account ID. Return only events with /// this account_id as either Actor, Context, or Participants.</param> /// <param name="time">Filter by time range.</param> /// <param name="category">Filter the returned events to a single category. Note that /// category shouldn't be provided together with event_type.</param> /// <param name="eventType">Filter the returned events to a single event type. Note /// that event_type shouldn't be provided together with category.</param> /// <param name="callback">The method to be called when the asynchronous send is /// completed.</param> /// <param name="callbackState">A user provided object that distinguished this send /// from other send requests.</param> /// <returns>An object that represents the asynchronous send request.</returns> public sys.IAsyncResult BeginGetEvents(uint limit = 1000, string accountId = null, global::Dropbox.Api.TeamCommon.TimeRange time = null, EventCategory category = null, EventTypeArg eventType = null, sys.AsyncCallback callback = null, object callbackState = null) { var getTeamEventsArg = new GetTeamEventsArg(limit, accountId, time, category, eventType); return(this.BeginGetEvents(getTeamEventsArg, callback, callbackState)); }