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 IMessageConsumer<MESSAGE> : Consumes<MESSAGE>.All where MESSAGE : class | |
| { } | |
| public class YourRegistry : Registry | |
| { | |
| public YourRegistry() | |
| { | |
| Scan(scan => | |
| { |
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
| [TestFixture] | |
| public class topshelf_configuration_extension | |
| { | |
| [Test] | |
| public void required_simple_services_should_be_registed_with_topshelf() | |
| { | |
| var container = new Container(c=>c.For<IRequiredService>().Use<TestRequiredService>()); | |
| var logger = MockRepository.GenerateMock<ILogger>(); | |
| var runConfiguration = RunnerConfigurator.New(config => config.ConfigureRequiredServices(container, logger)); |
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
| George Takei's totally random inclusion as a narrator was the type of non-sequitur humor that Community does so incredibly well. | |
| Ending the episode by having him give the gift of an awesome voicemail message to everyone named Kevin. | |
| "If your name's Kevin, here's a little freebie for your cellphone. | |
| 'Hi. Kevin can't come to the phone. He's on a spaceship with me, George Takei.Please leave a message.'" | |
| http://ology.com/screen/nbcs-thursday-night-recap-community-office-and-outsourced |
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 DovetailHtmlConventions : HtmlConventionRegistry | |
| { | |
| public DovetailHtmlConventions() | |
| { | |
| Displays | |
| .If(def => typeof (DateTime).IsAssignableFrom(def.Accessor.PropertyType) && def.Accessor.Name.EndsWith("Date")) | |
| .Modify((req, tag) => | |
| { | |
| var date = (DateTime) req.RawValue; | |
| tag.Text(date.ToShortDateString()); |
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 ModelMapSchemaValidationSource : IValidationSource | |
| { | |
| private readonly IContainer _container; | |
| private readonly SchemaValidationVisitor _schemaValidationVisitor; | |
| public ModelMapSchemaValidationSource(IContainer container, SchemaValidationVisitor schemaValidationVisitor) | |
| { | |
| _container = container; | |
| _schemaValidationVisitor = schemaValidationVisitor; | |
| } |
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
| <customErrors defaultRedirect="~/500" mode="On"> | |
| <error statusCode="500" redirect="~/500" /> | |
| <error statusCode="403" redirect="~/403" /> | |
| <error statusCode="404" redirect="~/404" /> | |
| </customErrors> |
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 Global : HttpApplication | |
| { | |
| protected void Application_OnError() | |
| { | |
| if (Context.IsCustomErrorEnabled && isAjaxRequest()) | |
| { | |
| // By default, customErrors will cause a 302 redirect | |
| // We really want a 500 response, so that the client request knows there was an error | |
| error_without_redirect(); | |
| } |
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 MailBee.Mime; | |
| namespace Dovetail.Carrier.EmailServices | |
| { | |
| public static class MailMessageExtensions | |
| { | |
| public static string GetMessageIdSansBrackets(this string messageId) | |
| { | |
| return messageId.TrimStart('<').TrimEnd('>'); | |
| } |
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
| var container = new Container(x => | |
| { | |
| x.AddRegistry<SettingsRegistry>(); | |
| x.AddRegistry<CommonsRegistry>(); | |
| x.AddRegistry<EmailServicesRegistry>(); | |
| }); | |
| var accountRepository = container.GetInstance<IEmailAccountRepository>(); | |
| var connectionManager = container.GetInstance<IMailBeeConnectionManager>(); | |
| var logger = container.GetInstance<ILogger>(); |
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
| private T with_timer<T>(Func<T> action) | |
| { | |
| Stopwatch sw = Stopwatch.StartNew(); | |
| var result = action(); | |
| sw.Stop(); | |
| TimeSpan time = sw.Elapsed; | |
| System.Console.WriteLine("Time: {0:00}:{1:00}:{2:00}.{3:000}", time.Hours, time.Minutes, time.Seconds, time.Milliseconds); |