xamarin/Xamarin.Build.AsyncTask

Name: Xamarin.Build.AsyncTask

Owner: Xamarin

Description: Repository for the AsyncTask and corresponding nuget package

Created: 2017-10-03 16:15:30.0

Updated: 2018-01-22 18:49:20.0

Pushed: 2017-10-25 16:03:53.0

Homepage: null

Size: 11

Language: C#

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Xamarin.Build.AsyncTask

Provides the AsyncTask to streamline the creation of long-running tasks that are cancellable and don't block the UI thread in Visual Studio.

Building
ild /t:restore && msbuild

That's it.

Installation
all-package Xamarin.Build.AsyncTask

If you're creating a custom task library, just inherit from Xamarin.Build.AsyncTask.

If you're creating an inline task that wants to inherit from AsyncTask, use the following as a template:

singTask TaskName="MyAsyncTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
  <!-- TODO: your task parameters -->
</ParameterGroup>
<Task>
  <Reference Include="$(AsyncTask)" />
  <Reference Include="System.Threading.Tasks"/>
  <Code Type="Class" Language="cs">
    <![CDATA[
    public class MyAsyncTask : Xamarin.Build.AsyncTask
    {
      public override bool Execute()
      {
        System.Threading.Tasks.Task.Run(async () =>
        {
          // TODO: do something long-running
          await System.Threading.Tasks.Task.Delay(5000);

          // Invoke Complete to signal you're done.
          Complete();
        });            

        return base.Execute();
      }
    }
    ]]>
  </Code>
</Task>
UsingTask>
CI Builds

Building and pushing from VSTS.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.