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
[a-zA-Z]+\/[0-9.]+\s?([(][a-zA-Z ;0-9.,]+[)])? |
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
AWidget.RelativeLayout InternalRelativeLayout | |
{ | |
get | |
{ | |
var field = typeof(RaisedTabbedPageRenderer).GetField("_relativeLayout", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance); | |
return (AWidget.RelativeLayout)field.GetValue(this); | |
} | |
set | |
{ | |
var field = typeof(RaisedTabbedPageRenderer).GetField("_relativeLayout", BindingFlags.NonPublic | BindingFlags.Instance); |
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.Reflection; | |
using Android.Content; | |
using Android.Support.Design.Widget; | |
using Android.Support.V4.View; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
using AWidget = Android.Widget; | |
using ATabbedRenderer = Xamarin.Forms.Platform.Android.AppCompat.TabbedPageRenderer; | |
using System.Collections.Specialized; |
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 ParameterizedFunc = System.Func<object, object>; | |
namespace CompanyName.Helpers | |
{ | |
public class Mapper | |
{ | |
private readonly IDictionary<(Type, Type), ParameterizedFunc> objectDictionary = | |
new Dictionary<(Type, Type), ParameterizedFunc>(); |
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 DataResponse<T> where T : class | |
{ | |
public T Data { get; set; } | |
public bool IsSuccess => Data != null; | |
System.Net.HttpStatusCode StatusCode { get; set; } | |
public string ErrorMessage { get; set; } | |
public long Count { get; set; } | |
public IEnumerable<TDestination> MapDataList<TSource, TDestination>() | |
where TSource : class | |
where TDestination : class |
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 AuthService : IAuthService | |
{ | |
AuthService(IDataService dataService) { } | |
void RequestAuth() | |
{ | |
var result = dataService.PostAsync(...) | |
} | |
} |
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
async Task<DataResponse<TModel>> SendAsync<TModel>(HttpMethod method, string path, object parameters, HttpContent content, CancellationToken cancellationToken) | |
{ | |
string errorMessage; | |
try | |
{ | |
OnPreSendAsync(adapter); | |
var response = await adapter.SendAsync<TModel>(method, path, parameters, content, cancellationToken); | |
return new DataResponse<TModel>(response); | |
} | |
catch (InvalidOperationException ex) { errorMessage = ex.Message; } |
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 DomainProvider : IDomainProvider | |
{ | |
public Uri BaseAddress { get; set; } | |
public DomainProvider(Uri baseAddress) | |
{ | |
BaseAddress = baseAddress; | |
} | |
public Uri Resolve(string path, object parameters) |
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
// This assumes you are using PropertyChanged.Fody | |
class ViewModel : INotifyPropertyChanged | |
{ | |
public bool Enabled { get; set; } | |
// more properties | |
protected void OnPropertyChanged(object sender, PropertyChangedEventArgs e) | |
{ | |
switch (e.PropertyName) | |
{ |