Beispiel #1
0
        void svc_GetUserProfileByNameCompleted(object sender, GetUserProfileByNameCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                //For each user
                foreach (UserProfileSvc.PropertyData propertyData in e.Result)
                {
                    switch (propertyData.Name)
                    {
                    case "PreferredName":
                        MyProfile.FullName = propertyData.Values.Count > 0
                                                                           ? (propertyData.Values[0].Value as string)
                                                                           : String.Empty;
                        break;

                    case "Title":
                        MyProfile.Title = propertyData.Values.Count > 0
                                                                           ? (propertyData.Values[0].Value as string)
                                                                           : String.Empty;
                        break;

                    case "AboutMe":
                        MyProfile.AboutMe = propertyData.Values.Count > 0
                                                                           ? (propertyData.Values[0].Value as string)
                                                                           : String.Empty;

                        break;

                    case "PictureURL":
                        MyProfile.PictureUrl = propertyData.Values.Count > 0
                                                                           ? (propertyData.Values[0].Value as string)
                                                                           : String.Empty;
                        break;
                    }
                }
            }
            else
            {
                Debug.WriteLine("Error: {0}", e.Error.Message);
            }
        }
Beispiel #2
0
 void svc_GetUserProfileByNameCompleted(object sender, GetUserProfileByNameCompletedEventArgs e)
 {
     //TODO : Complete the svc_GetUserProfileByNameCompleted event handler
 }