Skip to content

Instantly share code, notes, and snippets.

private async Task DownloadSomething()
{
using (var client = new WebClient())
{
var data = await client.DownloadDataTaskAsync(new Uri("https://www.google.pl"));
}
}
using (var client = new WebClient())
{
client.DownloadDataCompleted += Client_DownloadDataCompleted;
client.DownloadDataAsync(new Uri("https://www.google.pl"));
}
void Client_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
{
// Tutaj robimy coś z pobranymi danymi
<canvas id="myChart" width="200" height="200"></canvas>
<script>
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Red", "Blue"],
datasets: [{
label: 'Which color do you like?',
data: [12, 19],
<canvas id="myChart" width="200" height="200"></canvas>
<script>
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Red", "Blue"],
datasets: [{
label: 'Which color do you like?',
<!DOCTYPE html>
<html>
<head>
...
@Scripts.Render("https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js")
</head>
<body>
...
</body>
</html>
#tool nuget:?package=NUnit.Runners&version=2.6.4
Task("tests")
.Does(() =>
{
NUnit("./TestsProjectFolder/bin/Release/TestsProject.dll");
});
Task("build-android")
.IsDependentOn("restore")
.Does(() =>
{
MSBuild("./android_project_path.csproj",
c => c.SetConfiguration("Release")
.WithTarget("SignAndroidPackage")
);
});
Task("restore")
.Does(() =>
{
var nugetSettings = new NuGetRestoreSettings
{
ArgumentCustomization = args => args.Append("-PackagesDirectory ./packages")
};
NuGetRestore ("./project_path.csproj", nugetSettings);
});
Task("restore")
.Does(() =>
{
NuGetRestore ("./solution_path.sln");
});
Task("clean")
.Does (() =>
{
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});