Fixing samples for the rename of the Async methods

This commit is contained in:
Gilles Khouzam 2015-08-20 11:00:39 -07:00
Родитель 6a18833dd1
Коммит a9eeef18ea
13 изменённых файлов: 27 добавлений и 27 удалений

Просмотреть файл

@ -142,7 +142,7 @@ void Dialogs::Feed_Click(
params->Insert(L"link", L"https://en.wikipedia.org/wiki/Brussels_sprout");
params->Insert(L"description", L"Om Nom Nom!");
create_task(s->ShowFeedDialog(params))
create_task(s->ShowFeedDialogAsync(params))
.then([=](FBResult^ DialogResponse)
{
OutputDebugString(L"Showed 'Feed' dialog.\n");
@ -161,7 +161,7 @@ void Dialogs::AppRequests_Click(
params->Insert(L"title", L"I love Brussels Sprouts!");
params->Insert(L"message", L"Om Nom Nom!");
create_task(s->ShowRequestsDialog(params))
create_task(s->ShowRequestsDialogAsync(params))
.then([=](FBResult^ DialogResponse)
{
OutputDebugString(L"Showed 'Requests' dialog.\n");

Просмотреть файл

@ -184,7 +184,7 @@ void MainPage::LogoutAndRetry(
// be that the session has cached an access token that is no longer valid,
// e.g. if the user revoked the app in Settings. FBSession::Logout clears
// the session's cached access token, among other things.
create_task(FBSession::ActiveSession->Logout())
create_task(FBSession::ActiveSession->LogoutAsync())
.then([=]()
{
// Login call has to happen on UI thread, so circle back around to it
@ -206,7 +206,7 @@ void MainPage::login_OnClicked(
if (sess->LoggedIn)
{
sess->Logout();
sess->LogoutAsync();
LoginButton->Content = L"Logout";
LoginCpp::App^ a = dynamic_cast<LoginCpp::App^>(Application::Current);
Windows::UI::Xaml::Controls::Frame^ f = a->CreateRootFrame();

Просмотреть файл

@ -79,7 +79,7 @@ void UserLikes::AddLikes(
if (_likes->HasNext)
{
create_task(_likes->Next()).then([this](FBResult^ result)
create_task(_likes->NextAsync()).then([this](FBResult^ result)
{
if (result->Succeeded)
{
@ -110,7 +110,7 @@ void UserLikes::GetUserLikes(
});
_likes = ref new FBPaginatedArray(graphPath, nullptr, fact);
create_task(_likes->First()).then([this](FBResult^ result)
create_task(_likes->FirstAsync()).then([this](FBResult^ result)
{
if (result->Succeeded)
{
@ -142,7 +142,7 @@ void UserLikes::ListView_SelectionChanged(
return FBPageBindable::FromJson(JsonText);
}));
create_task(val->Get())
create_task(val->GetAsync())
.then([this](FBResult^ result)
{
if (result->Succeeded)

Просмотреть файл

@ -79,7 +79,7 @@ void UserLikes::AddLikes(
if (_likes->HasNext)
{
create_task(_likes->Next()).then([this](FBResult^ result)
create_task(_likes->NextAsync()).then([this](FBResult^ result)
{
if (result->Succeeded)
{
@ -110,7 +110,7 @@ void UserLikes::GetUserLikes(
});
_likes = ref new FBPaginatedArray(graphPath, nullptr, fact);
create_task(_likes->First()).then([this](FBResult^ result)
create_task(_likes->FirstAsync()).then([this](FBResult^ result)
{
if (result->Succeeded)
{
@ -142,7 +142,7 @@ void UserLikes::ListView_SelectionChanged(
return FBPageBindable::FromJson(JsonText);
}));
create_task(val->Get())
create_task(val->GetAsync())
.then([this](FBResult^ result)
{
if (result->Succeeded)

Просмотреть файл

@ -53,7 +53,7 @@ void LoginCpp::Dialogs::FeedDialogButton_Click(Platform::Object^ sender, Windows
params->Insert(L"link", L"https://en.wikipedia.org/wiki/Brussels_sprout");
params->Insert(L"description", L"Om Nom Nom!");
create_task(s->ShowFeedDialog(params))
create_task(s->ShowFeedDialogAsync(params))
.then([=](FBResult^ Response)
{
OutputDebugString(L"Showed 'Feed' dialog.\n");
@ -69,7 +69,7 @@ void LoginCpp::Dialogs::AppRequestsButton_Click(Platform::Object^ sender, Window
params->Insert(L"title", L"I love Brussels Sprouts!");
params->Insert(L"message", L"Om Nom Nom!");
create_task(s->ShowRequestsDialog(params))
create_task(s->ShowRequestsDialogAsync(params))
.then([=](FBResult^ Response)
{
OutputDebugString(L"Showed 'Requests' dialog.\n");

Просмотреть файл

@ -189,7 +189,7 @@ void MainPage::LogoutAndRetry(
// be that the session has cached an access token that is no longer valid,
// e.g. if the user revoked the app in Settings. FBSession::Logout clears
// the session's cached access token, among other things.
create_task(FBSession::ActiveSession->Logout())
create_task(FBSession::ActiveSession->LogoutAsync())
.then([=]()
{
// Login call has to happen on UI thread, so circle back around to it
@ -208,7 +208,7 @@ void MainPage::login_OnClicked(Platform::Object^ sender, Windows::UI::Xaml::Rout
if (sess->LoggedIn)
{
sess->Logout();
sess->LogoutAsync();
LoginButton->Content = L"Logout";
LoginCpp::App^ a = dynamic_cast<LoginCpp::App^>(Application::Current);
Windows::UI::Xaml::Controls::Frame^ f = a->CreateRootFrame();

Просмотреть файл

@ -142,7 +142,7 @@ void Dialogs::Feed_Click(
params->Insert(L"link", L"https://en.wikipedia.org/wiki/Brussels_sprout");
params->Insert(L"description", L"Om Nom Nom!");
create_task(s->ShowFeedDialog(params))
create_task(s->ShowFeedDialogAsync(params))
.then([=](FBResult^ Response)
{
OutputDebugString(L"Showed 'Feed' dialog.\n");
@ -161,7 +161,7 @@ void Dialogs::AppRequests_Click(
params->Insert(L"title", L"I love Brussels Sprouts!");
params->Insert(L"message", L"Om Nom Nom!");
create_task(s->ShowRequestsDialog(params))
create_task(s->ShowRequestsDialogAsync(params))
.then([=](FBResult^ Response)
{
OutputDebugString(L"Showed 'Requests' dialog.\n");

Просмотреть файл

@ -189,7 +189,7 @@ void MainPage::LogoutAndRetry(
// be that the session has cached an access token that is no longer valid,
// e.g. if the user revoked the app in Settings. FBSession::Logout clears
// the session's cached access token, among other things.
create_task(FBSession::ActiveSession->Logout())
create_task(FBSession::ActiveSession->LogoutAsync())
.then([=]()
{
// Login call has to happen on UI thread, so circle back around to it
@ -208,7 +208,7 @@ void MainPage::login_OnClicked(Platform::Object^ sender, Windows::UI::Xaml::Rout
if (sess->LoggedIn)
{
sess->Logout();
sess->LogoutAsync();
LoginButton->Content = L"Logout";
LoginCpp::App^ a = dynamic_cast<LoginCpp::App^>(Application::Current);
Windows::UI::Xaml::Controls::Frame^ f = a->CreateRootFrame();

Просмотреть файл

@ -45,7 +45,7 @@ namespace LoginCs
FBSingleValue val = new FBSingleValue("/" + ID, null,
new FBJsonClassFactory((JsonText) =>
MyFBPage.FromJson(JsonText)));
FBResult result = await val.Get();
FBResult result = await val.GetAsync();
if (result.Succeeded)
{
MyFBPage page = (MyFBPage)result.Object;

Просмотреть файл

@ -86,11 +86,11 @@ namespace LoginCs
FBSingleValue value = new FBSingleValue(path, parameters,
new FBJsonClassFactory(FBProfilePicture.FromJson));
FBResult result = await value.Get();
FBResult result = await value.GetAsync();
if (result.Succeeded)
{
FBProfilePicture pic = (FBProfilePicture)result.Object;
ProfilePicBrush.ImageSource = new BitmapImage(pic.URL);
ProfilePicBrush.ImageSource = new BitmapImage(new Uri(pic.Url));
}
}

Просмотреть файл

@ -76,7 +76,7 @@ namespace LoginCs
if (_likes.HasNext)
{
FBResult result = await _likes.Next();
FBResult result = await _likes.NextAsync();
if (result.Succeeded)
{
IReadOnlyList<object> nextPages =
@ -100,7 +100,7 @@ namespace LoginCs
(JsonText) => MyFBPage.FromJson(JsonText));
_likes = new FBPaginatedArray(graphPath, null, fact);
FBResult result = await _likes.First();
FBResult result = await _likes.FirstAsync();
if (result.Succeeded)
{
IReadOnlyList<object> pages =

Просмотреть файл

@ -195,7 +195,7 @@ namespace LoginCs
if (sess.LoggedIn)
{
LoginButton.Content = "Login";
await sess.Logout();
await sess.LogoutAsync();
//Navigate back to same page, to clear out logged in info.
App.RootFrame.Navigate(typeof(MainPage));
}
@ -211,7 +211,7 @@ namespace LoginCs
// and removed our app from their list off allowed apps in Settings.
if (WasAppPermissionRemovedByUser(result))
{
await sess.Logout();
await sess.LogoutAsync();
await TryRerequest(true);
}
else if (ShouldRerequest(result))

Просмотреть файл

@ -192,7 +192,7 @@ namespace LoginCs
if (sess.LoggedIn)
{
LoginButton.Content = "Login";
await sess.Logout();
await sess.LogoutAsync();
//Navigate back to same page, to clear out logged in info.
App.RootFrame.Navigate(typeof(MainPage));
}
@ -209,7 +209,7 @@ namespace LoginCs
// and removed our app from their list off allowed apps in Settings.
if (WasAppPermissionRemovedByUser(result))
{
await sess.Logout();
await sess.LogoutAsync();
}
else if (ShouldRerequest(result))
{