Esempio n. 1
0
        void GetUserPeople()
        {
            plusService = new ServicePlus()
            {
                RetryEnabled = true,
                Authorizer   = SignIn.SharedInstance.Authentication
            };

            // The following example uses the visible (PlusConstants.PlusCollectionVisible) collection to obtain a list of people
            // who the signed-in user has added to one or more circles, which is limited to the circles the
            // user made visible to the requesting app. This list does not include names of circles.
            var query = QueryPlus.QueryForPeopleListWithUserId("me", PlusConstants.PlusCollectionVisible);

            plusService.ExecuteQuery(query, (ticket, obj, error) => {
                // obj contains the query results, we must cast it to PlusPeopleFeed in order to get its information
                var peopleFeed = obj as PlusPeopleFeed;
                if (error != null)
                {
                    InvokeOnMainThread(() => new UIAlertView("Error", error.Description, null, "Ok", null).Show());
                }
                else
                {
                    var root = new RootElement("People List")
                    {
                        new Section()
                    };
                    foreach (var person in peopleFeed.Items)
                    {
                        root[0].Add(new StringElement(person.DisplayName));
                    }
                    var dvc = new DialogViewController(root, true);
                    InvokeOnMainThread(() => NavigationController.PushViewController(dvc, true));
                }
            });
        }
Esempio n. 2
0
        void GetUserInfo()
        {
            plusService = new ServicePlus()
            {
                RetryEnabled = true,
                Authorizer   = SignIn.SharedInstance.Authentication
            };

            // Create a QueryPlus object to get the details of the user with the given user ID.
            // The special value "me" indicates the currently signed in user, but you could use
            // any other valid user ID. Returns a PlusPerson.
            var query = QueryPlus.QueryForPeopleGetWithUserId("me");

            plusService.ExecuteQuery(query, (ticket, obj, error) => {
                // obj contains the query results, we must cast it to PlusPerson in order to get its information
                var person = obj as PlusPerson;
                if (error != null)
                {
                    InvokeOnMainThread(() => new UIAlertView("Error", error.Description, null, "Ok", null).Show());
                }
                else
                {
                    InvokeOnMainThread(() => {
                        var section = Root[0];
                        section.Add(new StyledStringElement("Display Name", person.DisplayName, UITableViewCellStyle.Subtitle));
                        section.Add(new StyledMultilineElement("About Me", person.AboutMe, UITableViewCellStyle.Subtitle));
                        section.Add(new StyledStringElement("Birthday", person.Birthday, UITableViewCellStyle.Subtitle));
                        ReloadData();
                    });
                }
            });
        }
Esempio n. 3
0
        void GetUserPeople()
        {
            plusService = new ServicePlus () {
                RetryEnabled = true,
                Authorizer = SignIn.SharedInstance.Authentication
            };

            // The following example uses the visible (PlusConstants.PlusCollectionVisible) collection to obtain a list of people
            // who the signed-in user has added to one or more circles, which is limited to the circles the
            // user made visible to the requesting app. This list does not include names of circles.
            var query = QueryPlus.QueryForPeopleListWithUserId ("me", PlusConstants.PlusCollectionVisible);
            plusService.ExecuteQuery (query, (ticket, obj, error) => {
                // obj contains the query results, we must cast it to PlusPeopleFeed in order to get its information
                var peopleFeed = obj as PlusPeopleFeed;
                if (error != null)
                    InvokeOnMainThread (() => new UIAlertView ("Error", error.Description, null, "Ok", null).Show ());
                else {
                    var root = new RootElement ("People List") { new Section () };
                    foreach (var person in peopleFeed.Items) {
                        root[0].Add (new StringElement (person.DisplayName));
                    }
                    var dvc = new DialogViewController (root, true);
                    InvokeOnMainThread (() => NavigationController.PushViewController (dvc, true));
                }
            });
        }
Esempio n. 4
0
        void GetUserInfo()
        {
            plusService = new ServicePlus () {
                RetryEnabled = true,
                Authorizer = SignIn.SharedInstance.Authentication
            };

            // Create a QueryPlus object to get the details of the user with the given user ID.
            // The special value "me" indicates the currently signed in user, but you could use
            // any other valid user ID. Returns a PlusPerson.
            var query = QueryPlus.QueryForPeopleGetWithUserId ("me");
            plusService.ExecuteQuery (query, (ticket, obj, error) => {
                // obj contains the query results, we must cast it to PlusPerson in order to get its information
                var person = obj as PlusPerson;
                if (error != null)
                    InvokeOnMainThread (() => new UIAlertView ("Error", error.Description, null, "Ok", null).Show ());
                else {
                    InvokeOnMainThread (() => {
                        var section = Root[0];
                        section.Add (new StyledStringElement ("Display Name", person.DisplayName, UITableViewCellStyle.Subtitle));
                        section.Add (new StyledMultilineElement ("About Me", person.AboutMe, UITableViewCellStyle.Subtitle));
                        section.Add (new StyledStringElement ("Birthday", person.Birthday, UITableViewCellStyle.Subtitle));
                        ReloadData ();
                    });
                }
            });
        }