Skip to content

Instantly share code, notes, and snippets.

View andreas-nesheim's full-sized avatar

Andreas Nesheim andreas-nesheim

View GitHub Profile
using var httpClient = new HttpClient();
stringResult = await httpClient.GetStringAsync(url);
jsonResult = JsonConvert.DeserializeObject<FeatureCollection>(stringResult);
foreach (var parkingZone in jsonResult.Features)
{
if (parkingZone.Geometry is not Polygon polygon) continue;
var points = polygon.Coordinates.First().Coordinates;
var mapPolygon = new Microsoft.Maui.Controls.Maps.Polygon
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Plugin.Firebase.CloudMessaging;
namespace MauiFirebasePush;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
name: .NET MAUI (Windows)
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
outputDirectory: '$(Build.BinariesDirectory)/$(buildConfiguration)'
HappyScaleLabel.Text = $"You are {smileScale * 100}% happy!";
var faceResult = detectResult.FirstOrDefault();
if (faceResult is null) return;
var smileScale = faceResult.FaceAttributes.Smile;
var detectResult = await faceClient.Face.DetectWithStreamAsync(fs, returnFaceAttributes: faceAttributes);
using FileStream fs = File.OpenRead(photo.FullPath);
var faceAttributes = new FaceAttributeType[] { FaceAttributeType.Smile };