This file contains hidden or 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
| 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: |
This file contains hidden or 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
| [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( |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
This file contains hidden or 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 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; |
NewerOlder

