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
// https://forums.xamarin.com/discussion/comment/119662/#Comment_119662 | |
public class IconTabbedRenderer : TabbedRenderer | |
{ | |
protected override void DispatchDraw( | |
global::Android.Graphics.Canvas canvas) | |
{ | |
base.DispatchDraw(canvas); | |
SetTabIcons(); |
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
// http://stackoverflow.com/a/14933245 | |
class JobProcessor<TInput, TOutput> : IDisposable | |
{ | |
private readonly Func<TInput, TOutput> m_transform; | |
// or a custom type instead of Tuple | |
private readonly | |
BlockingCollection<Tuple<TInput, TaskCompletionSource<TOutput>>> | |
m_queue = |
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
// http://blog.stephencleary.com/2015/04/a-tour-of-task-part-10-promise-tasks.html | |
public Task<string> GetValueAsync(int key) | |
{ | |
string result; | |
if (cache.TryGetValue(key, out result)) | |
return Task.FromResult(result); | |
return DoGetValueAsync(key); | |
} |
NewerOlder