atraczyk | 49f1b57 | 2016-10-27 12:33:28 -0400 | [diff] [blame^] | 1 | #include "pch.h"
|
| 2 |
|
| 3 | #include "UserModel.h"
|
| 4 |
|
| 5 | using namespace RingClientUWP;
|
| 6 |
|
| 7 | void
|
| 8 | UserModel::getUserData()
|
| 9 | {
|
| 10 | create_task(User::FindAllAsync())
|
| 11 | .then([=](IVectorView<User^>^ users) {
|
| 12 | for (size_t index = 0; index < users->Size; index++) {
|
| 13 | auto user = users->GetAt(index);
|
| 14 | if (user->AuthenticationStatus == UserAuthenticationStatus::LocallyAuthenticated &&
|
| 15 | user->Type == UserType::LocalUser) {
|
| 16 | User^ currentUser = user;
|
| 17 | create_task(currentUser->GetPropertyAsync(KnownUserProperties::FirstName))
|
| 18 | .then([=](Object^ result) {
|
| 19 | firstName = safe_cast<String^>(result);
|
| 20 | });
|
| 21 | create_task(currentUser->GetPropertyAsync(KnownUserProperties::LastName))
|
| 22 | .then([&](Object^ result) {
|
| 23 | lastName = safe_cast<String^>(result);
|
| 24 | });
|
| 25 | }
|
| 26 | }
|
| 27 | });
|
| 28 | } |