System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| public class HtmlBuilder { | |
| public static final String COLOR = "[color]"; | |
| public enum Type{ | |
| BOLD("strong"), | |
| ITALIC("em"), | |
| COLOR("font color=\"#"+ HtmlBuilder.COLOR + "\""), | |
| SMALL("small") | |
| ; | |
| public final String stringType; |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
Xamarin.Android.Support.v4[Android SDK location]\extras\android\m2repository\com\android\support and open the directory for the support library you need23.4.0.1 the support library version would be 23.4.0. If you did not create a folder in| [HttpPost] | |
| public HttpResponseMessage CreateCustomer(string name, string billingInfo) | |
| { | |
| Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo); | |
| Result<CustomerName> customerNameResult = CustomerName.Create(name); | |
| return Result.Combine(billingInfoResult, customerNameResult) | |
| .OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value)) | |
| .OnSuccess(() => new Customer(customerNameResult.Value)) | |
| .OnSuccess( |
| static void Main(string[] args) | |
| { | |
| var breakFast = await Task.Run( () => MakeBreakFast()); | |
| // once here I know breakfast is ready | |
| Eat(breakFast); | |
| } | |
| private static async Task<BreakFast> MakeBreakFast() | |
| { | |
| var taskToastBread = ToastBreadAsync(); | |
| // do not await. As soon as the procedure awaits come back to do the next statement: |
| static void Main(string[] args) | |
| { | |
| var result = await SumAsync(1,2); | |
| Console.WriteLine(result); | |
| } | |
| public static int Sum(int a, int b) => a + b; | |
| public static Task<int> SumAsync(int a, int b) => Task.Run(() => Sum(a, b)); |
| static void async Main(string[] args) | |
| { | |
| await FireAndForget(); | |
| Console.WriteLine("Caller"); | |
| FireAndForget(); | |
| Console.WriteLine("Caller"); | |
| } | |
| public static async Task FireAndForget() |
| static void async Main(string[] args) | |
| { | |
| try | |
| { | |
| await ThrowExceptionAfterAsync(); | |
| } | |
| catch(Exception e) | |
| { | |
| //Gonna catch SHU | |
| Console.WrileLine(e.Message);//SHU |
| static async void FireAndForget(this Task task) | |
| { | |
| try | |
| { | |
| await task; | |
| } | |
| catch (Exception e) | |
| { | |
| // log errors | |
| } |
| using System.Threading; | |
| namespace System.Globalization | |
| { | |
| public static class CultureInfo_Setters | |
| { | |
| public static void SetForApplication(this CultureInfo @this) | |
| { | |
| @this.SetForCurrentThread(); | |
| @this.SetForThreadPoolThreads(); |