// Execute all registered callbacks for the input broadcast type
 private void Broadcast(BroadcastType bt)
 {
     foreach (IPausable pausable in pausableDict[bt])
     {
         GetCallback(bt, pausable)();
     }
 }
Example #2
0
 private static void OnLeaderboardsLoaded(IntPtr leaderboardsPtr, int count, int callbackId)
 {
     Leaderboard[] leaderboards = new Leaderboard[count];
     for (int i = 0; i < count; i++)
     {
         leaderboards[i] = LeaderboardNativeToManaged(new IntPtr(leaderboardsPtr.ToInt64() + IntPtr.Size * i));
     }
     GetCallback <LeaderboardsCallback>(callbackId)(leaderboards);
 }
Example #3
0
        private static void OnLeaderboardLoadedWithId(IntPtr leaderboardPtr, int callbackId)
        {
            Leaderboard leaderboard = LeaderboardNativeToManaged(leaderboardPtr);

            if (string.IsNullOrEmpty(leaderboard.id))
            {
                throw new Exception("Loaded leaderboard id was empty.");
            }
            GetCallback <LeaderboardCallback>(callbackId)(leaderboard);
        }
Example #4
0
        private static void OnLeaderboardFriendsScoresLoaded(IntPtr leaderboardPtr, IntPtr entriesPtr, int count, int callbackId)
        {
            Leaderboard leaderboard = LeaderboardNativeToManaged(leaderboardPtr);

            LeaderboardEntry[] entries = new LeaderboardEntry[count];
            int size = Marshal.SizeOf(typeof(LeaderboardEntry));

            for (int i = 0; i < count; i++)
            {
                entries[i] = (LeaderboardEntry)Marshal.PtrToStructure(new IntPtr(entriesPtr.ToInt64() + i * size), typeof(LeaderboardEntry));
            }
            GetCallback <LeaderboardEntryCallback>(callbackId)(leaderboard, entries);
        }
Example #5
0
        public void GetCallBack(string url, GetCallback callBack)
        {
            var result = dataObj.GetAsync(url);

            // obj.Invoke(result);
            callBack(result);
        }
Example #6
0
 private static T Get <T>(String key, GetCallback <T> callback)
 {
     if (cache != null && cache[key] != null && cache[key].GetType() == typeof(T))
     {
         return((T)cache[key]);
     }
     else
     {
         object value = callback();
         Set <T>(key, (T)value);
         return((T)value);
     }
 }
Example #7
0
        private notifications Get(bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.notifications.get" }
            };

            if (isAsync)
            {
                SendRequestAsync(parameterList, new FacebookCallCompleted <notifications>(callback), state);
                return(null);
            }

            return(SendRequest <notifications_get_response>(parameterList));
        }
Example #8
0
        private IList <comment> Get(string xid, bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.comments.get" }
            };

            Utilities.AddRequiredParameter(parameterList, "xid", xid);

            if (isAsync)
            {
                SendRequestAsync <comments_get_response, IList <comment> >(parameterList, new FacebookCallCompleted <IList <comment> >(callback), state, "comment");
                return(null);
            }

            var response = SendRequest <comments_get_response>(parameterList);

            return(response == null ? null : response.comment);
        }
Example #9
0
        private IList <note> Get(long uid, bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.notes.get" }
            };

            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync <notes_get_response, IList <note> >(parameterList, new FacebookCallCompleted <IList <note> >(callback), state, "note");
                return(null);
            }

            var response = SendRequest <notes_get_response>(parameterList);

            return(response == null ? null : response.note);
        }
Example #10
0
 /// <summary>
 /// Returns all visible groups according to the filters specified.
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     List&lt;long&gt; gids = new List&lt;long&gt; { Constants.GroupId };
 ///     api.Groups.GetAsync(gids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="gids">Filter by this list of group ids. This is a List of gids.</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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(List <long> gids, GetCallback callback, Object state)
 {
     GetAsync(Session.UserId, gids, callback, state);
 }
Example #11
0
 /// <summary>
 /// Returns all visible groups according to the filters specified.
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     List&lt;long&gt; gids = new List&lt;long&gt; { Constants.GroupId };
 ///     api.Groups.GetAsync(Constants.UserId, gids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by groups associated with a user with this uid</param>
 /// <param name="gids">Filter by this list of group ids. This is a List of gids.</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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(long uid, List <long> gids, GetCallback callback, Object state)
 {
     Get(uid, gids, true, callback, state);
 }
Example #12
0
 /// <summary>
 ///     Calls the callback of a given menu item.
 /// </summary>
 /// <param name="item"> The item of which invoke the callback. </param>
 public void Active(string item)
 {
     GetCallback(item)(item);
 }
Example #13
0
 /// <summary>
 /// Returns all visible groups according to the filters specified.
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Groups.GetAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(GetCallback callback, Object state)
 {
     GetAsync(Session.UserId, null, callback, state);
 }
Example #14
0
 private object GetDescription()
 {
     if (label.InvokeRequired)
     {
         GetCallback d = new GetCallback(GetDescription);
         return this.Invoke(d);
     }
     else
     {
         return label.Text;
     }
 }
        private IList<comment> Get(string xid, bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.comments.get" } };
            Utilities.AddRequiredParameter(parameterList, "xid", xid);

            if (isAsync)
            {
                SendRequestAsync<comments_get_response, IList<comment>>(parameterList, new FacebookCallCompleted<IList<comment>>(callback), state, "comment");
                return null;
            }

            var response = SendRequest<comments_get_response>(parameterList);
            return response == null ? null : response.comment;
        }
        private IList<photo> Get(string subj_id, string aid, List<string> pids
            ,bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> {{"method", "facebook.photos.get"}};
            Utilities.AddOptionalParameter(parameterList, "subj_id", subj_id);
            Utilities.AddOptionalParameter(parameterList, "aid", aid);
            Utilities.AddList(parameterList, "pids", pids);

            if (isAsync)
            {
                SendRequestAsync<photos_get_response, IList<photo>>(parameterList, new FacebookCallCompleted<IList<photo>>(callback), state, "photo");
                return null;
            }

            var response = SendRequest<photos_get_response>(parameterList);
            return response == null ? null : response.photo;
        }
        private IList<link> Get(long uid, bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.links.get" } };
            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync<links_get_response, IList<link>>(parameterList, new FacebookCallCompleted<IList<link>>(callback), state, "link");
                return null;
            }

            var response = SendRequest<links_get_response>(parameterList);
            return response == null ? null : response.link;
        }
Example #18
0
 private object GetValue()
 {
     if (progressBar.InvokeRequired)
     {
         GetCallback d = new GetCallback(GetValue);
         return (int)this.Invoke(d);
     }
     else
     {
         return progressBar.Value;
     }
 }
Example #19
0
 /// <summary>
 /// Returns all comments for a given xid posted through fb:comments. This method is a wrapper for the FQL query on the comment FQL table.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Comments.GetAsync("xid_test", AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;comment&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="xid">The comment xid that you want to retrieve. For a Comments Box, you can determine the xid on the admin panel or in the application settings editor in the Facebook Developer application.</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 comments for a given xid.</returns>
 public void GetAsync(string xid, GetCallback callback, Object state)
 {
     Get(xid, true, callback, state);
 }
Example #20
0
 private object GetTitle()
 {
     if (this.InvokeRequired)
     {
         GetCallback d = new GetCallback(GetTitle);
         return this.Invoke(d);
     }
     else
     {
         return this.Text;
     }
 }
Example #21
0
 private object GetProgressBarStyle()
 {
     if (progressBar.InvokeRequired)
     {
         GetCallback d = new GetCallback(GetProgressBarStyle);
         return this.Invoke(d);
     }
     else
     {
         return progressBar.Style;
     }
 }
Example #22
0
 private object GetMin()
 {
     if (progressBar.InvokeRequired)
     {
         GetCallback d = new GetCallback(GetMin);
         return (int)this.Invoke(d);
     }
     else
     {
         return progressBar.Minimum;
     }
 }
 /// <summary>
 /// Returns all links the user has posted on their profile through your application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Links.GetAsync(AsyncDemoCompleted, null);
 /// } 
 ///
 /// private static void AsyncDemoCompleted(IList&lt;link&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 an List of link data.</returns>
 /// <remarks>For desktop applications, don't specify a uid; keep the default. (Default value is the logged-in user.)</remarks>
 public void GetAsync(GetCallback callback, Object state)
 {
     Get(0, true, callback, state);
 }
Example #24
0
 /// <summary>
 /// Returns a list of all of the visible notes written by the specified user.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///    Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///    api.Notes.GetAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;note&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 a List of notes with their data in their respective fields (note_id, title, content, created_time, updated_time, uid).</returns>
 /// <remarks> For desktop applications, don't specify a uid; keep the default. (Default value is the logged-in user.)</remarks>
 public void GetAsync(GetCallback callback, Object state)
 {
     GetAsync(0, callback, state);
 }
 /// <summary>
 /// Returns all links the user has posted on their profile through your application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Links.GetAsync(Constants.UserId, AsyncDemoCompleted, null);
 /// } 
 ///
 /// private static void AsyncDemoCompleted(IList&lt;link&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">he user ID of the user whose links you want to retrieve.</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 an List of link data.</returns>
 /// <remarks>For desktop applications, don't specify a uid; keep the default. (Default value is the logged-in user.)</remarks>
 public void GetAsync(long uid, GetCallback callback, Object state)
 {
     Get(uid, true, callback, state);
 }
Example #26
0
        private static void OnLeaderboardPositionLoaded(IntPtr leaderboardPtr, int totalEntries, int position, int callbackId)
        {
            Leaderboard leaderboard = LeaderboardNativeToManaged(leaderboardPtr);

            GetCallback <LeaderboardPositionCallback>(callbackId)(leaderboard, totalEntries, position);
        }
 /// <summary>
 /// Returns all visible photos according to the filters specified.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Photos.GetAsync(string.Empty, Constants.AlbumId.ToString(), null, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;photo&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="subj_id">Filter by photos tagged with this user.</param>
 /// <param name="aid">Filter by photos in this album.</param>
 /// <param name="pids">Filter by photos in this list. This is a comma-separated list of pids.</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 visible photos satisfying the filters specified. The method can be used to return all photos tagged with user, in an album, query a specific set of photos by a list of pids, or filter on any combination of these three.</returns>
 /// <remarks>It is an error to omit all three of the subj_id, aid, and pids parameters. They have no defaults.</remarks>
 public void GetAsync(string subj_id, string aid, List<string> pids, GetCallback callback, Object state)
 {
     Get(subj_id, aid, pids, true, callback, state);
 }
        private notifications Get(bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.notifications.get" } };

            if (isAsync)
            {
                SendRequestAsync(parameterList, new FacebookCallCompleted<notifications>(callback), state);
                return null;
            }

            return SendRequest<notifications_get_response>(parameterList);
        }
        public override Brush GetBrush(SvgVisualElement renderingElement, ISvgRenderer renderer, float opacity, bool forStroke = false)
        {
            LoadStops(renderingElement);

            if (this.Stops.Count < 1)
            {
                return(null);
            }
            if (this.Stops.Count == 1)
            {
                var   stopColor = this.Stops[0].GetColor(renderingElement);
                int   alpha     = (int)Math.Round((opacity * (stopColor.A / 255.0f)) * 255);
                Color colour    = System.Drawing.Color.FromArgb(alpha, stopColor);
                return(new SolidBrush(colour));
            }

            try
            {
                if (this.GradientUnits == SvgCoordinateUnits.ObjectBoundingBox)
                {
                    renderer.SetBoundable(renderingElement);
                }

                var points = new PointF[] {
                    SvgUnit.GetDevicePoint(NormalizeUnit(this.X1), NormalizeUnit(this.Y1), renderer, this),
                    SvgUnit.GetDevicePoint(NormalizeUnit(this.X2), NormalizeUnit(this.Y2), renderer, this)
                };

                var bounds = renderer.GetBoundable().Bounds;
                if (bounds.Width <= 0 || bounds.Height <= 0 || ((points[0].X == points[1].X) && (points[0].Y == points[1].Y)))
                {
                    return(GetCallback?.Invoke().GetBrush(renderingElement, renderer, opacity, forStroke));
                }

                using (var transform = EffectiveGradientTransform)
                {
                    var midPoint = new PointF((points[0].X + points[1].X) / 2, (points[0].Y + points[1].Y) / 2);
                    transform.Translate(bounds.X, bounds.Y, MatrixOrder.Prepend);
                    if (this.GradientUnits == SvgCoordinateUnits.ObjectBoundingBox)
                    {
                        // Transform a normal (i.e. perpendicular line) according to the transform
                        transform.Scale(bounds.Width, bounds.Height, MatrixOrder.Prepend);
                        transform.RotateAt(-90.0f, midPoint, MatrixOrder.Prepend);
                    }
                    transform.TransformPoints(points);
                }

                if (this.GradientUnits == SvgCoordinateUnits.ObjectBoundingBox)
                {
                    // Transform the normal line back to a line such that the gradient still starts in the correct corners, but
                    // has the proper normal vector based on the transforms.  If you work out the geometry, these formulas should work.
                    var midPoint = new PointF((points[0].X + points[1].X) / 2, (points[0].Y + points[1].Y) / 2);
                    var dy       = (points[1].Y - points[0].Y);
                    var dx       = (points[1].X - points[0].X);
                    var x2       = points[0].X;
                    var y2       = points[1].Y;

                    if (Math.Round(dx, 4) == 0)
                    {
                        points[0] = new PointF(midPoint.X + dy / 2 * bounds.Width / bounds.Height, midPoint.Y);
                        points[1] = new PointF(midPoint.X - dy / 2 * bounds.Width / bounds.Height, midPoint.Y);
                    }
                    else if (Math.Round(dy, 4) == 0)
                    {
                        points[0] = new PointF(midPoint.X, midPoint.Y - dx / 2 * bounds.Height / bounds.Width);
                        points[1] = new PointF(midPoint.X, midPoint.Y + dx / 2 * bounds.Height / bounds.Width);;
                    }
                    else
                    {
                        var startX = (float)((dy * dx * (midPoint.Y - y2) + Math.Pow(dx, 2) * midPoint.X + Math.Pow(dy, 2) * x2) /
                                             (Math.Pow(dx, 2) + Math.Pow(dy, 2)));
                        var startY = dy * (startX - x2) / dx + y2;
                        points[0] = new PointF(startX, startY);
                        points[1] = new PointF(midPoint.X + (midPoint.X - startX), midPoint.Y + (midPoint.Y - startY));
                    }
                }

                var effectiveStart = points[0];
                var effectiveEnd   = points[1];

                if (PointsToMove(renderingElement, points[0], points[1]) > LinePoints.None)
                {
                    var expansion = ExpandGradient(renderingElement, points[0], points[1]);
                    effectiveStart = expansion.StartPoint;
                    effectiveEnd   = expansion.EndPoint;
                }

                var result = new LinearGradientBrush(effectiveStart, effectiveEnd, System.Drawing.Color.Transparent, System.Drawing.Color.Transparent)
                {
                    InterpolationColors = CalculateColorBlend(renderer, opacity, points[0], effectiveStart, points[1], effectiveEnd),
                    WrapMode            = WrapMode.TileFlipX
                };
                return(result);
            }
            finally
            {
                if (this.GradientUnits == SvgCoordinateUnits.ObjectBoundingBox)
                {
                    renderer.PopBoundable();
                }
            }
        }
        private stream_data Get(long viewer_id, List<long> source_ids, DateTime? start_time, DateTime? end_time, int? limit, string filter_key, bool isAsync, GetCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.stream.get" } };
            Utilities.AddOptionalParameter(parameterList, "viewer_id", viewer_id);
            Utilities.AddList(parameterList, "source_ids", source_ids);
            Utilities.AddOptionalParameter(parameterList, "start_time", DateHelper.ConvertDateToDouble(start_time));
            Utilities.AddOptionalParameter(parameterList, "end_time", DateHelper.ConvertDateToDouble(end_time));
            Utilities.AddOptionalParameter(parameterList, "limit", limit);
            Utilities.AddOptionalParameter(parameterList, "filter_key", filter_key);

            if (isAsync)
            {
               	    SendRequestAsync<stream_get_response>(parameterList, new FacebookCallCompleted<stream_get_response>(callback), state);
                return null;
            }

            return SendRequest<stream_get_response>(parameterList, true);
        }
Example #31
0
 /// <summary>
 /// Returns a list of all of the visible notes written by the specified user.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///    Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///    api.Notes.GetAsync(Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;note&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">The user ID of the user whose notes you want to retrieve.</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 a List of notes with their data in their respective fields (note_id, title, content, created_time, updated_time, uid).</returns>
 /// <remarks> For desktop applications, don't specify a uid; keep the default. (Default value is the logged-in user.)</remarks>
 public void GetAsync(long uid, GetCallback callback, Object state)
 {
     Get(uid, true, callback, state);
 }
Example #32
0
 /// <summary>
 /// Asynchronous get method.
 /// </summary>
 /// <param name="id">The identifier string.</param>
 /// <param name="getCallback">Code to call when the loading is done.</param>
 /// <exception cref="System.NotImplementedException"></exception>
 /// <remarks>
 /// The design doesn't follow any of the standard .NET asynchronous patterns like APM, EAP, or TAP.
 /// It's close to JavaScript where you just provide an "onLoad" handler that's called when the object
 /// is retrieved and decoded. This is to enable AssetProviders to be implemented using standard
 /// JavaScript DOM objects like Image. See the article
 /// <a href="https://msdn.microsoft.com/en-us/library/hh873178(v=vs.110).aspx">Interop with Other Asynchronous Patterns and Types</a>
 /// to get an idea how to map this pattern, which is similar to APM (albeit simpler), to the currently en-vogue TAP (async/await) pattern.
 /// </remarks>
 public void BeginGetAsset(string id, GetCallback getCallback)
 {
     // TODO: Implement Asynchronous loading
     throw new NotImplementedException();
 }
 /// <summary>
 /// This method returns an object that contains the stream from the perspective of a specific viewer -- a user or a Facebook Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey));
 ///     api.Stream.GetAsync(0, null, DateTime.Now.AddYears(-2), DateTime.Now, 0, null, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(stream_data result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="viewerId">The user ID for whom you are fetching stream data. You can pass 0 for this parameter to retrieve publicly viewable information.</param>
 /// <param name="sourceIds">An array containing all the stream data for the user profiles and Pages connected to the viewer_id. You can filter the stream to include posts by the IDs you specify here. (Default value is all connections of the viewer.)</param>
 /// <param name="startTime">The earliest DateTime for which to retrieve posts from the stream. The start_time uses the updated_time field in the stream (FQL) table as the baseline for determining the earliest time for which to get the stream.</param>
 /// <param name="endTime">The latest DateTime for which to retrieve posts from the stream. The end_time uses the updated_time field in the stream (FQL) table as the baseline for determining the latest time for which to get the stream.</param>
 /// <param name="limit">The total number of posts to return. (Default value is 30 posts.)</param>
 /// <param name="filter_key">A filter associated with the user. Filters get returned by stream.getFilters or the stream_filter FQL table. To filter for stream posts from your application, look for a filter with a filter_key set to app_YOUR_APPLICATION_ID.</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 a stream_data object containing the following arrays:  posts, which is an array of post data, containing the fields defined by the stream (FQL) table.  profiles, which is an array of profile information, containing the fields defined by the profile (FQL) table.  albums, which is an array of album information, containing the field as defined by the album (FQL) table.</returns>
 public void GetAsync(long viewerId, List<long> sourceIds, DateTime? startTime, DateTime? endTime, int? limit, string filter_key, GetCallback callback, Object state)
 {
     Get(viewerId, sourceIds, startTime, endTime, limit, filter_key, true, callback, state);
 }
 /// <summary>
 /// Returns all visible groups according to the filters specified.  
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Groups.GetAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(GetCallback callback, Object state)
 {
     GetAsync(Session.UserId, null, callback, state);
 }
 /// <summary>
 /// This method returns an object that contains the stream from the perspective of a specific viewer -- a user or a Facebook Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey));
 ///     api.Stream.GetAsync(null, DateTime.Now.AddYears(-2), DateTime.Now, 0, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(stream_data result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="sourceIds">An array containing all the stream data for the user profiles and Pages connected to the viewer_id. You can filter the stream to include posts by the IDs you specify here. (Default value is all connections of the viewer.)</param>
 /// <param name="startTime">The earliest DateTime for which to retrieve posts from the stream. The start_time uses the updated_time field in the stream (FQL) table as the baseline for determining the earliest time for which to get the stream.</param>
 /// <param name="endTime">The latest DateTime for which to retrieve posts from the stream. The end_time uses the updated_time field in the stream (FQL) table as the baseline for determining the latest time for which to get the stream.</param>
 /// <param name="limit">The total number of posts to return. (Default value is 30 posts.)</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 a stream_data object containing the following arrays:  posts, which is an array of post data, containing the fields defined by the stream (FQL) table.  profiles, which is an array of profile information, containing the fields defined by the profile (FQL) table.  albums, which is an array of album information, containing the field as defined by the album (FQL) table.</returns>
 public void GetAsync(List<long> sourceIds, DateTime? startTime, DateTime? endTime, int? limit, GetCallback callback, Object state)
 {
     GetAsync(Session.UserId, sourceIds, startTime, endTime, limit, string.Empty, callback, state);
 }
 /// <summary>
 /// Returns all visible groups according to the filters specified.  
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     List&lt;long&gt; gids = new List&lt;long&gt; { Constants.GroupId };
 ///     api.Groups.GetAsync(gids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="gids">Filter by this list of group ids. This is a List of gids.</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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(List<long> gids, GetCallback callback, Object state)
 {
     GetAsync(Session.UserId, gids, callback, state);
 }
 /// <summary>
 /// Returns all visible groups according to the filters specified.  
 /// This may be used to find all groups of which a user is as member, or to query specific gids.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     List&lt;long&gt; gids = new List&lt;long&gt; { Constants.GroupId };
 ///     api.Groups.GetAsync(Constants.UserId, gids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;group&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">Filter by groups associated with a user with this uid</param>
 /// <param name="gids">Filter by this list of group ids. This is a List of gids.</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 groups satisfying the filters specified. The method can be used to return all groups associated with user, or query a specific set of events by a list of gids. If both the uid and gids parameters are provided, the method returns all groups in the set of gids, with which the user is associated. If the gids parameter is omitted, the method returns all groups associated with the provided user.</returns>
 /// <remarks>Group creators will be visible to an application only if the creator has not turned off access to the Platform or used the application'; If the creator has opted out, the creator element will appear as nil=true.</remarks>
 public void GetAsync(long uid, List<long> gids, GetCallback callback, Object state)
 {
     Get(uid, gids, true, callback, state);
 }
 /// <summary>
 /// Returns all comments for a given xid posted through fb:comments. This method is a wrapper for the FQL query on the comment FQL table.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Comments.GetAsync("xid_test", AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;comment&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="xid">The comment xid that you want to retrieve. For a Comments Box, you can determine the xid on the admin panel or in the application settings editor in the Facebook Developer application.</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 comments for a given xid.</returns>
 public void GetAsync(string xid, GetCallback callback, Object state)
 {
     Get(xid, true, callback, state);
 }