View StringConverter.cs
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
namespace CSharp | |
{ | |
public static class StringConverter | |
{ | |
public static string Capitalized(string text) | |
{ | |
if (string.IsNullOrEmpty(text)) | |
{ | |
return text; | |
} |
View BytesConverter.cs
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 CSharp | |
{ | |
public static class BytesConverter | |
{ | |
public static double ConvertBytesToKB(long bytes) | |
{ | |
return bytes / 1024f; | |
} |
View DpiToPixelConverter.cs
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.App; | |
using Android.Content; | |
namespace Droid | |
{ | |
public static class DpiToPixelConverter | |
{ | |
public static int Convert(int dpi) | |
{ | |
float scale = Application.Context.Resources.DisplayMetrics.Density; |
View RoundedCornersFrameLayout.cs
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 Android.Graphics; | |
using Android.Util; | |
using Android.Widget; | |
namespace Droid | |
{ | |
public class RoundedCornersFrameLayout : FrameLayout | |
{ | |
private const float CornerRadius = 5.0f; |
View CurrentActivityUtil.cs
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.Collections.Generic; | |
using System.Linq; | |
using Android.Runtime; | |
using Android.Util; | |
using Java.Lang; | |
using Java.Util; | |
namespace Droid | |
{ | |
public static class CurrentActivityUtil |
View RotatedTextView.cs
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 Android.Widget; | |
using Android.Util; | |
using Android.Graphics; | |
namespace Droid | |
{ | |
public class RotatedTextView : TextView | |
{ | |
public RotatedTextView(Context ctx, IAttributeSet attr) |
View AsyncLock.cs
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.Threading; | |
using System.Threading.Tasks; | |
namespace CSharp | |
{ | |
// http://blogs.msdn.com/b/pfxteam/archive/2012/02/12/10266988.aspx | |
public class AsyncLock | |
{ |
View BitmapExtensions.cs
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.App; | |
using Android.Support.V8.Renderscript; | |
namespace Droid | |
{ | |
public static class BitmapUtil | |
{ | |
public static Bitmap Blur(Bitmap originalBitmap) | |
{ | |
// Create the Renderscript instance that will do the work. |
View DpiToPixelConverter.cs
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; | |
namespace Droid | |
{ | |
public static class DpiToPixelConverter | |
{ | |
public static int Convert(int dpi) | |
{ | |
float scale = Application.Context.Resources.DisplayMetrics.Density; | |
return (int)(dpi * scale + 0.5f); |
View BaseRepository
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.Tasks; | |
using System.Collections.Generic; | |
using SQLite; | |
using System.Linq.Expressions; | |
using System.Linq; | |
namespace SQLite | |
{ | |
public interface IBaseRepository<TEntity, TPrimaryKey> |