Skip to content

Instantly share code, notes, and snippets.

View sonnemaf's full-sized avatar

Fons Sonnemans sonnemaf

View GitHub Profile
@akarpov89
akarpov89 / InterpolatedParsing.cs
Created October 1, 2021 14:58
Interpolated parsing technique
using System.Runtime.CompilerServices;
using static ParsingExtensions;
string input = "Name: Andrew; Age: 31";
string? name = null;
int age = 0;
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}"))
{
private async Task CropImage()
{
// Create destination file and obtain sharing token
var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("Cropped.jpg", CreationCollisionOption.ReplaceExisting);
var token = SharedStorageAccessManager.AddFile(file);
// Specify the app to launch using LaunchUriForResults
var options = new LauncherOptions();
options.TargetApplicationPackageFamilyName = "Microsoft.Windows.Photos_8wekyb3d8bbwe";