示例#1
0
        // Actions to add: Post/Delete a Hello, see friend list, see Group and Publish a Photo
        void AddActionsSection()
        {
            strPostHello = new CustomStringElement("Post \"Hello\" on your wall", PostHello);

            var actionsSection = new Section("Actions")
            {
                strPostHello
            };

            if (AccessToken.CurrentAccessToken.HasGranted("read_custom_friendlists"))
            {
                actionsSection.Add(new StringElement("See Friendlist", () => {
                    NavigationController.PushViewController(new ListViewController(FacebookListType.Friends), true);
                }));
            }

            if (AccessToken.CurrentAccessToken.HasGranted("user_managed_groups"))
            {
                actionsSection.Add(new StringElement("See Managed Groups", () => {
                    NavigationController.PushViewController(new ListViewController(FacebookListType.Groups), true);
                }));
            }

            actionsSection.Add(new StringElement("Publish photo", PostPhoto));

            Root.Add(actionsSection);
        }
		// Actions to add: Post/Delete a Hello, see friend list, see Group and Publish a Photo
		void AddActionsSection ()
		{
			strPostHello = new CustomStringElement ("Post \"Hello\" on your wall", PostHello);

			var actionsSection = new Section ("Actions") {
				strPostHello
			};

			if (AccessToken.CurrentAccessToken.HasGranted ("read_custom_friendlists"))
				actionsSection.Add (new StringElement ("See Friendlist", () => {
					NavigationController.PushViewController (new ListViewController (FacebookListType.Friends), true);
				}));

			if (AccessToken.CurrentAccessToken.HasGranted ("user_managed_groups"))
				actionsSection.Add (new StringElement ("See Managed Groups", () => {
					NavigationController.PushViewController (new ListViewController (FacebookListType.Groups), true);
				}));

			actionsSection.Add (new StringElement ("Publish photo", PostPhoto));

			Root.Add (actionsSection);
		}