Exemple #1
0
 /// <summary>
 /// Load synchronously.  Call with a await Task.Run(()=>LoadAllGroups()); to run async.
 /// </summary>
 protected void LoadAllGroups()
 {
     if (haveAccessToken)
     {
         LinkedInGetGroupOptions options = new LinkedInGetGroupOptions();
         options.GroupOptions.SelectAll();
         LinkedInResponse <IEnumerable <LinkedInGroup> > groupResult = linkedInClient.GetMemberGroups(options);
         groupResult.Result.ForEach(g => groups[g.Id] = g);
     }
 }
        public void LKI_LoadGroups()
        {
            if (haveAccessToken)
            {
                LinkedInGetGroupOptions options = new LinkedInGetGroupOptions();
                options.GroupOptions.SelectAll();

                LinkedInResponse <IEnumerable <LinkedInGroup> > result = linkedInClient.GetMemberGroups(options);

                if (result.Result != null && result.Status == LinkedInResponseStatus.OK)
                {
                    //ShowMemberGroups(result);
                }
            }
        }
        protected async void LoadGroups()
        {
            if (haveAccessToken)
            {
                tvGroups.Nodes.Clear();
                tvGroups.Nodes.Add("Loading...");
                LinkedInGetGroupOptions options = new LinkedInGetGroupOptions();
                options.GroupOptions.SelectAll();

                LinkedInResponse <IEnumerable <LinkedInGroup> > result = await Task.Run(() => linkedInClient.GetMemberGroups(options));

                if (result.Result != null && result.Status == LinkedInResponseStatus.OK)
                {
                    ShowMemberGroups(result);
                }
                else
                {
                    ReRun(result.Status, result.Message);
                }
            }
        }