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 Strong | |
{ | |
using System; | |
using ActorLite; | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
new Ping(5).Start(new Pong()); |
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 StrongCrawling | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using ActorLite; | |
public interface ICrawlRequestHandler | |
{ | |
void Crawl(Monitor monitor, string url); |
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 Test | |
{ | |
using System; | |
using System.Collections.Generic; | |
using ActorLite; | |
public interface IPersonHandler | |
{ | |
void Chat(Person another, Topic topic); | |
void Eat(Restaurant restaurant); |
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 StrongCrawling | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using ActorLite; | |
public interface ICrawlRequestHandler |
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 Crawling | |
{ | |
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using ActorLite; |
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
static string DoPre(string content) | |
{ | |
return Regex.Replace(content, @"(<pre[^>]*>)([\s\S]*?)(</pre>)", match => | |
{ | |
return | |
match.Groups[1].Value + | |
String.Join("<br />", match.Groups[2].Value.Split('\n').Select(p => p.Replace(" ", " ").Trim()).ToArray()) + | |
match.Groups[3].Value; | |
}); | |
} |
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 class AreaControllerFactory : IControllerFactory | |
{ | |
private Dictionary<string, string> m_areaPartMapping = new Dictionary<string, string>(); | |
private ReaderWriterLockSlim m_rwLock = new ReaderWriterLockSlim(); | |
private Dictionary<string, Type> m_controllerTypes = new Dictionary<string, Type>(); | |
public string NamespaceBase { get; private set; } | |
public AreaControllerFactory(string namespaceBase) | |
: this(namespaceBase, 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
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)] | |
public class AttachDataAttribute : Attribute | |
{ | |
public AttachDataAttribute(object key, object value) | |
{ | |
this.Key = key; | |
this.Value = value; | |
} | |
public AttachDataAttribute() { } |
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 class BoundUrl | |
{ | |
private static PropertyAccessor s_urlAccessor; | |
static BoundUrl() | |
{ | |
var type = typeof(Route).Assembly.GetType("System.Web.Routing.BoundUrl"); | |
var property = type.GetProperty("Url", BindingFlags.Instance | BindingFlags.Public); | |
s_urlAccessor = new PropertyAccessor(property); | |
} |
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
internal class DomainParser | |
{ | |
public DomainParser(string pattern) | |
{ | |
this.Pattern = pattern; | |
this.Segments = CaptureSegments(pattern); | |
string routePattern = pattern.Replace("://", "/").Replace('.', '/'); | |
this.m_parsedRoute = RouteParser.Parse(routePattern); |