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
# ~/.osx — http://mths.be/osx | |
# root check | |
if [[ $EUID -ne 0 ]]; then | |
echo "################################"; | |
echo "## YOU ARE NOT RUNNING AS ROOT #"; | |
echo "################################"; | |
echo "#"; | |
echo "# USAGE: sudo $0"; | |
exit; |
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
/// <summary> | |
/// Methods for handling property names and values, using reflection. | |
/// </summary> | |
public static class PropertyUtil | |
{ | |
public static string GetPropertyName<TObject, TValue>(this TObject type, | |
Expression<Func<TObject, TValue>> propertySelector) | |
{ | |
return GetPropertyNameCore(propertySelector.Body); |
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; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; |
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 BarCodeView : ImageView | |
{ | |
private string _code; | |
public string Code | |
{ | |
get { return _code; } | |
set | |
{ | |
if (_code != value) |
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 PolymorphicListAdapter : MvxAdapter | |
{ | |
private IDictionary<Type, int> TemplateIdByType { get; set; } | |
public override int ViewTypeCount | |
{ | |
get { return TemplateIdByType.Count; } | |
} | |
private PolymorphicListAdapter(Context context, IMvxAndroidBindingContext bindingContext) : base(context, bindingContext) |
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; | |
using Android.App; | |
using Android.Content; | |
using Android.Support.V13.App; | |
using Cirrious.MvvmCross.Droid.FullFragging.Fragments; | |
using Cirrious.MvvmCross.ViewModels; | |
using Java.Lang; | |
using String = Java.Lang.String; |
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 Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Support.V7.App; | |
using Cirrious.CrossCore.Core; | |
using Cirrious.CrossCore.Droid.Views; | |
namespace ECC.Mobile.Droid.Views | |
{ |
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 Android.Content; | |
using Cirrious.MvvmCross.Binding.BindingContext; | |
using Cirrious.MvvmCross.Binding.Droid.BindingContext; | |
using Cirrious.MvvmCross.Droid.Views; | |
using Cirrious.MvvmCross.ViewModels; | |
namespace ECC.Mobile.Droid.Views | |
{ | |
public class MvxActionBarActivity : MvxActionBarEventSource, IMvxAndroidView | |
{ |
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 static class MethodBindingExtensions | |
{ | |
public static MvxFluentBindingDescription<TTarget, TSource> ToMethod<TTarget, TSource>(this MvxFluentBindingDescription<TTarget, TSource> description, Expression<Func<TSource, Action>> method) where TTarget : class | |
{ | |
var name = FindMethodName(method); | |
return description.To(name); | |
} | |
public static MvxFluentBindingDescription<TTarget, TSource> ToMethod<TTarget, TSource>(this MvxFluentBindingDescription<TTarget, TSource> description, Expression<Func<TSource, Func<Task>>> method) where TTarget : class | |
{ | |
var name = FindMethodName(method); |
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
// From http://stackoverflow.com/a/19221385/500976 | |
// In Setup.cs: | |
// protected override void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry) | |
// { | |
// base.FillTargetFactories(registry); | |
// registry.RegisterCustomBindingFactory("FocusText", (EditText view) => new FocusTextBinding(view)); | |
// } | |
using System; | |
using Android.Views; |
OlderNewer