コード例 #1
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
        private IList <facebookevent> Get(long?uid, List <long> eids, DateTime?startTime, DateTime?endTime, string rsvp_status
                                          , bool isAsync, GetEventsCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.events.get" }
            };

            Utilities.AddOptionalParameter(parameterList, "uid", uid);
            Utilities.AddList(parameterList, "eids", eids);
            Utilities.AddOptionalParameter(parameterList, "start_time", DateHelper.ConvertDateToDouble(startTime));
            Utilities.AddOptionalParameter(parameterList, "end_time", DateHelper.ConvertDateToDouble(endTime));
            Utilities.AddOptionalParameter(parameterList, "rsvp_status", rsvp_status);

            if (isAsync)
            {
                SendRequestAsync <events_get_response, IList <facebookevent> >(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <IList <facebookevent> >(callback), state, "facebookevent");
                return(null);
            }

            var response = SendRequest <events_get_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));

            return(response == null ? null : response.facebookevent);
        }
コード例 #2
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, new List&lt;long&gt; { Constants.EventId }, new DateTime(2000, 1, 1), DateTime.Now.AddYears(1), AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="startTime">Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound.</param>
 /// <param name="endTime">Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns>
 public void GetAsync(long?uid, List <long> eids, DateTime?startTime, DateTime?endTime, GetEventsCallback callback, Object state)
 {
     GetAsync(uid, eids, null, null, null, callback, state);
 }
コード例 #3
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, new List&lt;long&gt; { Constants.EventId }, new DateTime(2000, 1, 1), DateTime.Now.AddYears(1), "attending", AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="startTime">Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound.</param>
 /// <param name="endTime">Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound.</param>
 /// <param name="rsvp_status">Filter by this RSVP status.  attending,unsure,declined,not_replied </param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns>
 public void GetAsync(long?uid, List <long> eids, DateTime?startTime, DateTime?endTime, string rsvp_status, GetEventsCallback callback, Object state)
 {
     Get(uid, eids, startTime, endTime, rsvp_status, true, callback, state);
 }
コード例 #4
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns>
 public void GetAsync(long?uid, GetEventsCallback callback, Object state)
 {
     GetAsync(uid, null, null, null, null, callback, state);
 }
コード例 #5
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(new List&lt;long&gt; { Constants.EventId }, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns>
 public void GetAsync(List <long> eids, GetEventsCallback callback, Object state)
 {
     GetAsync(0, eids, null, null, null, callback, state);
 }
コード例 #6
0
        private IList<facebookevent> Get(long? uid, List<long> eids, DateTime? startTime, DateTime? endTime, string rsvp_status
            , bool isAsync, GetEventsCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.events.get" } };
            Utilities.AddOptionalParameter(parameterList, "uid", uid);
            Utilities.AddList(parameterList, "eids", eids);
            Utilities.AddOptionalParameter(parameterList, "start_time", DateHelper.ConvertDateToDouble(startTime));
            Utilities.AddOptionalParameter(parameterList, "end_time", DateHelper.ConvertDateToDouble(endTime));
            Utilities.AddOptionalParameter(parameterList, "rsvp_status", rsvp_status);

            if (isAsync)
            {
                SendRequestAsync<events_get_response, IList<facebookevent>>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<IList<facebookevent>>(callback), state, "facebookevent");
                return null;
            }

            var response = SendRequest<events_get_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? null : response.facebookevent;
        }
コード例 #7
0
ファイル: Events.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns>
 public void GetAsync(GetEventsCallback callback, Object state)
 {
     Get(Session.UserId, null, null, null, null, true, callback, state);
 }
コード例 #8
0
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, new List&lt;long&gt; { Constants.EventId }, new DateTime(2000, 1, 1), DateTime.Now.AddYears(1), "attending", AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="startTime">Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound.</param>
 /// <param name="endTime">Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound.</param>
 /// <param name="rsvp_status">Filter by this RSVP status.  attending,unsure,declined,not_replied </param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns> 
 public void GetAsync(long? uid, List<long> eids, DateTime? startTime, DateTime? endTime, string rsvp_status, GetEventsCallback callback, Object state)
 {
     Get(uid, eids, startTime, endTime, rsvp_status, true, callback, state);
 }
コード例 #9
0
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, new List&lt;long&gt; { Constants.EventId }, new DateTime(2000, 1, 1), DateTime.Now.AddYears(1), AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="startTime">Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound.</param>
 /// <param name="endTime">Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns> 
 public void GetAsync(long? uid, List<long> eids, DateTime? startTime, DateTime? endTime, GetEventsCallback callback, Object state)
 {
     GetAsync(uid, eids, null, null, null, callback, state);
 }
コード例 #10
0
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(new List&lt;long&gt; { Constants.EventId }, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="eids">Filter by this list of event ids. This is a comma-separated list of eids.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns> 
 public void GetAsync(List<long> eids, GetEventsCallback callback, Object state)
 {
     GetAsync(0, eids, null, null, null, callback, state);
 }
コード例 #11
0
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by events associated with a user with this uid.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns> 
 public void GetAsync(long? uid, GetEventsCallback callback, Object state)
 {
     GetAsync(uid, null, null, null, null, callback, state);
 }
コード例 #12
0
 /// <summary>
 /// Returns all visible events according to the filters specified.
 /// This may be used to find all events of a user, or to query specific eids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Events.GetAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;facebookevent&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids.</returns> 
 public void GetAsync(GetEventsCallback callback, Object state)
 {
     Get(Session.UserId, null, null, null, null, true, callback, state);
 }