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 System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
namespace MiscUtil.Reflection | |
{ | |
/// <summary> | |
/// Non-generic class allowing properties to be copied from one instance | |
/// to another existing instance of a potentially different type. |
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 System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Utils | |
{ | |
public static class Progress | |
{ | |
public static Task ProgressDots(CancellationToken token) | |
{ |
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
<ListView SeparatorWidth="2" | |
PullToRefreshCommand="{Binding Fetch}" | |
ItemTappedCommand="{Binding Navigate}"> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<ViewCell> | |
<ViewCell.ItemStyles> | |
<ViewCellItemStyle State="Normal" BackgroundColor="White" SeparatorColor="Red" /> | |
<ViewCellItemStyle State="Pressed" BackgroundColor="Grey" SeparatorColor="Blue" /> | |
<ViewCellItemStyle State="LongPressed" BackgroundColor="Green" SeparatorColor="Pink" /> |
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 System; | |
using System.Linq; | |
using Xamarin.Forms; | |
namespace Helpers | |
{ | |
public class FontData | |
{ | |
public double FontSize { get; set; } | |
public FontAttributes FontAttributes { get; set; } |
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 TouchableBoxViewRenderer_Droid : BoxRenderer | |
{ | |
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.NewElement == null) return; | |
var attrs = new[] {Android.Resource.Attribute.SelectableItemBackground}; | |
var ta = Context.ObtainStyledAttributes(attrs); |
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
// iOS | |
public class Localize : ILocalize | |
{ | |
private static CultureInfo _currentCulture; | |
public CultureInfo GetCurrentCultureInfo() | |
{ | |
if (_currentCulture != null) | |
{ |
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
$path ='C:\Android\android-ndk' | |
$ndk = 'android-ndk-r11c' | |
$fullPath = Join-Path $path $ndk | |
if(!(Test-Path $fullPath)){ | |
New-Item $path -Force -ItemType directory | |
(New-Object Net.WebClient).DownloadFile("http://dl.google.com/android/repository/$ndk-windows-x86.zip", "C:\Temp\$ndk-windows-x86.zip") | |
(new-object -com shell.application).namespace("$path").CopyHere((new-object -com shell.application).namespace("C:\Temp\$ndk-windows-x86.zip").Items(),16) | |
$regPath = 'HKCU:\Software\Novell\Mono for Android' | |
$regKey = 'AndroidNdkDirectory' | |
$regValue = $fullPath |
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
app.Invoke("Backdoor", "MyActualMethod") |
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
#region Private Functions | |
function Get-AsciiBytes($str){ | |
return [System.Text.Encoding]::ASCII.GetBytes($str) | |
} | |
function Write-MultiPartProperty { | |
param( | |
[parameter(Mandatory=$true)][System.IO.MemoryStream] $body, | |
[parameter(Mandatory=$true)][string] $boundary, | |
[parameter(Mandatory=$true)][string] $key, |
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 System; | |
namespace Foo.Bar.Baz | |
{ | |
/// <summary> | |
/// Allows us to define actual LatLong in our models and have all platforms handle them whether | |
/// they use float, decimal, or double as their underlying types. | |
/// </summary> | |
/// <remarks>Our "opinion" is that at the end of the day, a <see cref="LatLong"/> is simply a <see cref="Double"/></remarks> | |
public struct LatLong |