This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- | |
How to define a variable. | |
Just stick a new node in a property group. | |
--> | |
<PropertyGroup> | |
<!-- This node in a property group will define a variable --> | |
<TestVariable>Test Variable Value</TestVariable> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ViewModel().Run(); | |
class ViewModel | |
{ | |
private bool flag = true; | |
public bool Flag {get; set;} = false; | |
public void Run() | |
{ | |
using(new HoldAndChangeValue(ref flag, () => Flag = !Flag)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
namespace GeneralBench; | |
public record Registro | |
{ | |
public required string Nome { get; init; } | |
public int Total { get; init; } | |
} | |
[MemoryDiagnoser] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
SharpLab tools in Run mode: | |
• value.Inspect() | |
• Inspect.Heap(object) | |
• Inspect.Stack(value) | |
• Inspect.MemoryGraph(value1, value2, …) | |
*/ | |
using System; | |
using System.Threading.Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GravatarImageSource : ImageSource | |
{ | |
/// <summary>The backing store for the <see cref="Email" /> bindable property.</summary> | |
public static readonly BindableProperty? EmailProperty = BindableProperty.Create(nameof(Email), typeof(string), typeof(GravatarImageSource), defaultValue: GravatarImageSourceDefaults.DefaultEmail, propertyChanged: OnEmailPropertyChanged); | |
/// <summary>The backing store for the <see cref="Image" /> bindable property.</summary> | |
public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(Image), typeof(DefaultImage), typeof(GravatarImageSource), defaultValue: GravatarImageSourceDefaults.Defaultimage, propertyChanged: OnDefaultImagePropertyChanged); | |
/// <summary>Gets or sets the email address.</summary> | |
public string? Email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlaP | |
{ | |
public static async Task<T> FromJsonHttpContent<T>(HttpContent httpContent) | |
{ | |
Stream stream = null; | |
try | |
{ | |
stream = await httpContent.ReadAsStreamAsync(); | |
var res = DeserializeJsonFromsStream<T>(stream); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class ComicRouteFactory | |
{ | |
public static RouteFactory Create<TPage, TViewModel>() | |
where TPage : Page, new() | |
where TViewModel : BaseViewModel | |
{ | |
return new Factory<TPage, TViewModel>(); | |
} | |
private class Factory<GPage, GViewModel> : RouteFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LibVLCSharp.Shared; | |
using static MediaPlayerX.Helpers.GlobalResources; | |
using MediaPlayerX.Models; | |
using System; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
using MediaPlayerX.Helpers; | |
using System.Collections.ObjectModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CornerRadiusEffect | |
{ | |
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.CreateAttached( | |
nameof(CornerRadius), | |
typeof(CornerRadius), | |
typeof(CornerRadiusEffect), | |
default(CornerRadius), | |
propertyChanged: OnCornerRadiusPropertyChanged); | |
static void OnCornerRadiusPropertyChanged(BindableObject bindable, object oldValue, object newValue) |
NewerOlder