C# C++;CX Windows RT创建任务处理返回与C混淆 InstalledLocation->GetFolderAsync(“资产”)) 。然后([inputMarkupFilename](存储文件夹^AssetFolder)->IAsyncOperation^ { 返回AssetFolder->GetFileAsync(inputMarkupFilename); } )。然后([](存储文件^MarkupStorage文件)->IAsyncOperation^ { 返回文件IO::ReadTextAsync(MarkupStorage文件); }//一直到这里都没碰过 //)。然后([this,outputImageFilename,size](平台::字符串^markupContent) )。然后([this,outputImageFilename,size](平台::字符串^markupContent)->Windows::基金会::IAsyncOperationWithProgress^ { 标记=标记内容; HttpClient ^hc=ref新HttpClient(); 返回hc->GetStringAsync(参考新Uri(“www.bing.com”); } )。然后([this,outputImageFilename,size](平台::字符串^httpContent) { Border^Border=(Border^)XamlReader::加载(标记); //获取http数据,将其拆分并使用“平铺”设置一些文本块 //返回。。。 });
C#: 在C++ cx中,我能看到的唯一方法是:C# C++;CX Windows RT创建任务处理返回与C混淆 InstalledLocation->GetFolderAsync(“资产”)) 。然后([inputMarkupFilename](存储文件夹^AssetFolder)->IAsyncOperation^ { 返回AssetFolder->GetFileAsync(inputMarkupFilename); } )。然后([](存储文件^MarkupStorage文件)->IAsyncOperation^ { 返回文件IO::ReadTextAsync(MarkupStorage文件); }//一直到这里都没碰过 //)。然后([this,outputImageFilename,size](平台::字符串^markupContent) )。然后([this,outputImageFilename,size](平台::字符串^markupContent)->Windows::基金会::IAsyncOperationWithProgress^ { 标记=标记内容; HttpClient ^hc=ref新HttpClient(); 返回hc->GetStringAsync(参考新Uri(“www.bing.com”); } )。然后([this,outputImageFilename,size](平台::字符串^httpContent) { Border^Border=(Border^)XamlReader::加载(标记); //获取http数据,将其拆分并使用“平铺”设置一些文本块 //返回。。。 });,c#,task-parallel-library,c++-cx,windows-rt,C#,Task Parallel Library,C++ Cx,Windows Rt,C#: 在C++ cx中,我能看到的唯一方法是: static String^ markup = ref new String(); return create_task(Package::Current->InstalledLocation->GetFolderAsync("Assets")) .then([inputMarkupFilename](StorageFolder^ assetsFolder) ->IAsyncOperation<Stora
static String^ markup = ref new String();
return create_task(Package::Current->InstalledLocation->GetFolderAsync("Assets"))
.then([inputMarkupFilename](StorageFolder^ assetsFolder) ->IAsyncOperation<StorageFile^>^
{
return assetsFolder->GetFileAsync(inputMarkupFilename);
}
).then([](StorageFile^ markupStorageFile) ->IAsyncOperation<Platform::String^>^
{
return FileIO::ReadTextAsync(markupStorageFile);
} //untouched upto here
//).then([this, outputImageFilename, size](Platform::String^ markupContent)
).then([this, outputImageFilename, size](Platform::String^ markupContent) -> Windows::Foundation::IAsyncOperationWithProgress<Platform::String^, Windows::Web::Http::HttpProgress>^
{
markup = markupContent;
HttpClient ^hc = ref new HttpClient();
return hc->GetStringAsync(ref new Uri("www.bing.com"));
}
).then([this, outputImageFilename, size](Platform::String^ httpContent)
{
Border^ border = (Border^)XamlReader::Load(markup);
// Take http data, split it and using 'tile' set some TextBlocks
// return ...
});
静态字符串^markup=ref new String();
返回创建任务(Package::Current->InstalledLocation->GetFolderAsync(“资产”))
。然后([inputMarkupFilename](存储文件夹^AssetFolder)->IAsyncOperation^
{
返回AssetFolder->GetFileAsync(inputMarkupFilename);
}
)。然后([](存储文件^MarkupStorage文件)->IAsyncOperation^
{
返回文件IO::ReadTextAsync(MarkupStorage文件);
}//一直到这里都没碰过
//)。然后([this,outputImageFilename,size](平台::字符串^markupContent)
)。然后([this,outputImageFilename,size](平台::字符串^markupContent)->Windows::基金会::IAsyncOperationWithProgress^
{
标记=标记内容;
HttpClient ^hc=ref新HttpClient();
返回hc->GetStringAsync(参考新Uri(“www.bing.com”);
}
)。然后([this,outputImageFilename,size](平台::字符串^httpContent)
{
Border^Border=(Border^)XamlReader::加载(标记);
//获取http数据,将其拆分并使用“平铺”设置一些文本块
//返回。。。
});
这应该行得通
task<StorageFolder^>(Package::Current->InstalledLocation->GetFolderAsync("Assets")).then([](StorageFolder^ folder) {
task<StorageFile^>(folder->GetFileAsync("customTile.xml")).then([](StorageFile^ file) {
task<String^>(FileIO::ReadTextAsync(file)).then([](String^ markupContent) {
auto hc = ref new HttpClient();
task<String^>(hc->GetStringAsync(ref new Uri("www.bing.com"))).then([markupContent](String^ httpContent) {
auto border = (Border^) XamlReader::Load(markupContent);
// Take http data, split it and using 'tile' set some TextBlocks
});
});
});
});
task(Package::Current->InstalledLocation->GetFolderAsync(“资产”)。然后([](StorageFolder^文件夹){
任务(文件夹->GetFileAsync(“customTile.xml”)。然后([](存储文件^file){
任务(FileIO::ReadTextAsync(文件))。然后([](字符串^markupContent){
auto hc=ref new HttpClient();
任务(hc->GetStringAsync(参考新Uri(“www.bing.com”))。然后([markupContent](字符串^httpContent){
自动边框=(边框^)XamlReader::加载(markupContent);
//获取http数据,将其拆分并使用“平铺”设置一些文本块
});
});
});
});
task<StorageFolder^>(Package::Current->InstalledLocation->GetFolderAsync("Assets")).then([](StorageFolder^ folder) {
task<StorageFile^>(folder->GetFileAsync("customTile.xml")).then([](StorageFile^ file) {
task<String^>(FileIO::ReadTextAsync(file)).then([](String^ markupContent) {
auto hc = ref new HttpClient();
task<String^>(hc->GetStringAsync(ref new Uri("www.bing.com"))).then([markupContent](String^ httpContent) {
auto border = (Border^) XamlReader::Load(markupContent);
// Take http data, split it and using 'tile' set some TextBlocks
});
});
});
});