This file contains hidden or 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
var response = await GetAsync (requestUri, token); | |
var responseType = response.Content?.Headers?.ContentType?.MediaType; | |
this.Debug (String.Format ("Response {0} ({1}) -> {2}", (int)response.StatusCode, response.StatusCode.ToString (), responseType)); | |
var responseText = await response.Content.ReadAsStringAsync (); |
This file contains hidden or 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 System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace MyNamespace | |
{ | |
public class LoggingHttpClientHandler : HttpClientHandler | |
{ |
This file contains hidden or 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 static class EnumExtensions | |
{ | |
public static string Description(this Enum e) | |
{ | |
var type = e.GetType(); | |
var name = Enum.GetName(type, e); | |
var memberInfo = type.GetTypeInfo() | |
.DeclaredMembers | |
.Where(p => p.Name == name) |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
namespace MyNamespace |
This file contains hidden or 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
// from https://forums.xamarin.com/discussion/comment/279890/#Comment_279890 | |
public partial class GradientView : ContentView | |
{ | |
public Color StartColor { get; set; } = Color.Transparent; | |
public Color EndColor { get; set; } = Color.Transparent; | |
public bool Horizontal { get; set; } = false; | |
public GradientView() | |
{ |
This file contains hidden or 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
// from https://forums.xamarin.com/discussion/100540/set-default-culture-to-culture-of-device | |
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(CultureInfo.CurrentUICulture.ToString()); | |
This file contains hidden or 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
// from https://forums.xamarin.com/discussion/comment/168974/#Comment_168974 | |
public class BindableToolbarItem : ToolbarItem | |
{ | |
public static readonly BindableProperty IsVisibleProperty = | |
BindableProperty.Create("IsVisible", typeof (bool), typeof (BindableToolbarItem), | |
true, BindingMode.TwoWay, propertyChanged: OnIsVisibleChanged); | |
public BindableToolbarItem() | |
{ |
This file contains hidden or 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 System; | |
using System.Drawing; | |
// adapted from https://stackoverflow.com/a/37980328 | |
namespace FrameworkInterface | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) |
This file contains hidden or 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 System; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
using Nito.AsyncEx; | |
namespace Core.Utility | |
{ | |
public abstract class BaseOperation<TInput, TOutput> | |
{ | |
public TaskCompletionSource<TOutput> TaskCompletionSource { get; } |
This file contains hidden or 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 System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace EventActionFunc | |
{ | |
public class Program | |
{ | |
static async Task Main(string[] args) | |
{ |