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
// Created by por Jone Polvora | |
// Twitter: @jpolvora | |
// WebSite: http://silverlightrush.blogspot.com | |
// Based on Dynamic Decorator / CBO Extender Project (http://www.codeproject.com/Articles/275292/Component-Based-Object-Extender) | |
// Depends on Impromptu-Interface (https://code.google.com/p/impromptu-interface/_ | |
// Last Update: 21/05/2012 10:40AM GMT -04:00 | |
// Brazil | |
/* USAGE EXAMPLE |
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 static class CaliburnExtensions | |
{ | |
public static IEnumerable<IResult> BeginExecute(this IEnumerable<Func<IResult>> routines) | |
{ | |
return routines.Select(routine => routine()); | |
} | |
public static void AsCoroutine(this IEnumerable<IResult> routine, | |
EventHandler<ResultCompletionEventArgs> callBack = null, | |
ActionExecutionContext ctx = null) |
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
//Original Idea: http://blog.smoothfriction.nl/archive/2012/05/07/silverlight-busyindicator-in-caliburn-micro-pt-2-again.aspx | |
//A simpler solution: | |
public interface IBusy | |
{ | |
bool IsBusy { get; set; } | |
} |
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
//Usage: | |
public IEnumerable<IResult> Logout() | |
{ | |
yield return new ActionResult(completed => | |
{ | |
var operation = WebContext.Current.Authentication.Logout(false); | |
operation.Completed += (sender, args) => completed(); | |
}); | |
} |
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.IO; | |
using System.Linq; | |
using System.Net; | |
namespace AsyncKonsole | |
{ | |
class Program | |
{ |
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
#include <stdio.h> | |
#define MAX 20000 | |
int main (){ | |
int i; | |
int x[MAX]; | |
for(i=0;i<MAX;i++){ | |
x[i] = i+1;} |
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
<!-- Custom caching policy for on HTTP POST for Azure API Management: | |
1. Policy looks in the Request body - 'cacheKey' property which then used as cache key. | |
Expected values are: <null>, ALL or NOEXPIRED | |
Defaults to ALL in case <null> | |
2. Cache expiration set to 60 seconds/1 minute | |
!--> | |
<policies> | |
<inbound> | |
<base /> |