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
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using StructureMap; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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 JsonResponse | |
{ | |
private readonly IList<string> _errors = new List<string>(); | |
public bool Success { get; set; } | |
public IEnumerable<string> Errors { get { return _errors; } } | |
public void RegisterError(string error) | |
{ | |
_errors.Fill(error); |
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 interface IContentPart { } | |
public class TitlePart : IContentPart { // whatever else } | |
public class BodyPart : IContentPart { // whatever else } |
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 DefaultPolicy : IPolicy | |
{ | |
public bool Matches() | |
{ | |
return true; | |
} | |
public void Execute() | |
{ | |
// default behavior |
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 interface IStringifier | |
{ | |
bool Matches(StringifyRequest request); | |
string Stringify(StringifyRequest request); | |
} |
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 ConfigureStringifierExpression | |
{ | |
private readonly Func<StringifyRequest, bool> _predicate; | |
private readonly StringifierModel _model; | |
public ConfigureStringifierExpression(Func<StringifyRequest, bool> predicate, StringifierModel model) | |
{ | |
_predicate = predicate; | |
_model = model; | |
} |
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 interface IConfigurationAction | |
{ | |
void Configure(SemanticModel model); | |
} |
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 interface IModelTypeCoordinator | |
{ | |
IValidationModel FindGetFor(Type postType); | |
} |
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 ModelFinder : IModelFinder | |
{ | |
private readonly BehaviorGraph _graph; | |
public ModelFinder(BehaviorGraph graph) | |
{ | |
_graph = graph; | |
} | |
public Type FindRelatedModel(Type type) |
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
jBus.routing = new (function() { | |
function lazy(builder) { | |
this.builder = builder; | |
this.buildWith = function(func) { | |
this.builder = func; | |
}; | |
this.value = function() { | |
return this.builder(); | |
}; |