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 Probability : IEquatable<Probability> | |
{ | |
#region Equality members | |
public bool Equals(Probability other) | |
{ | |
return EqualsWithin(other, 5); | |
} | |
public override bool Equals(object obj) |
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 MyUserControlView() | |
{ | |
InitializeComponent(); | |
var mouseUp = Observable.FromEventPattern< | |
MouseButtonEventHandler, | |
MouseButtonEventArgs> | |
(h => MouseLeftButtonUp += h, h => MouseLeftButtonUp -= h); | |
var doubleClick = mouseUp.SelectMany( |
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 Item { | |
public ReactiveCommand Remove{ get; protected set; } | |
} | |
public class MyModel { | |
public ObservableCollection<Item> Items { get; protected set; } | |
} | |
MyModel model = new MyModel{Items = { new Item(), new Item() }}; | |
this.Items = model.Items.CreateDerivedCollection(projectFunction); | |
// how to wire existing Item's RemoveIt command here? |
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
bus.Register(new LoggedAttribute().Apply<SendEmail>(message => | |
{ | |
using (var client = new SmtpClient()) | |
{ | |
client.Send(message); | |
} | |
})); |
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 ICheckRequests | |
{ | |
bool IsLocal(); | |
} | |
public class ProductionRequestChecker : ICheckRequests | |
{ | |
public bool IsLocal() | |
{ | |
return HttpContext.Current.Request.IsLocal; |
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 CassetteBundleConfiguration : IConfiguration<BundleCollection> | |
{ | |
public void Configure(BundleCollection bundles) | |
{ | |
bundles.Add<StylesheetBundle>("content/bootstrap/metro-bootstrap", new[] {"metro-bootstrap.less"}); | |
bundles.Add<StylesheetBundle>("content/bootstrap", new[] {"bootstrap.less"}); | |
bundles.Add<StylesheetBundle>("content/css/app", new[] {"main.less"}); | |
bundles.AddPerIndividualFile<StylesheetBundle>("content/css/lib", new FileSearch | |
{ |
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 ClaimsModuleSpecifications | |
{ | |
public Specification list_of_existing_claims() | |
{ | |
return new ModuleSpecification<ClaimsModule> | |
{ | |
Bootstrap = bootstrapper => { }, | |
When = () => UserAgent.Get("/claims"), | |
Expect = | |
{ |
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 static class CriteriaExtensions | |
{ | |
public static string IsEqualTo(this string criteria) | |
{ | |
return String.Format("= '{0}'", criteria ?? string.Empty); | |
} | |
} |
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 CommandBinder : IModelBinder | |
{ | |
private readonly IEnumerable<ITypeConverter> typeConverters; | |
private readonly IEnumerable<IBodyDeserializer> bodyDeserializers; | |
private readonly IFieldNameConverter fieldNameConverter; | |
private readonly BindingDefaults defaults; | |
public CommandBinder( | |
IEnumerable<ITypeConverter> typeConverters, IEnumerable<IBodyDeserializer> bodyDeserializers, | |
IFieldNameConverter fieldNameConverter, BindingDefaults defaults) |
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
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> | |
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/> | |
</sectionGroup> | |
<section name="razor" type="Nancy.ViewEngines.Razor.RazorConfigurationSection, Nancy.ViewEngines.Razor"/> | |
</configSections> | |
<appSettings> | |
<add key="webPages:Enabled" value="false"/> |