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
/* | |
NHibernate now has the BeforeBindMapping event which gives you access to the object representation of the HBM XML files at runtime. | |
Use the BeforeBindMapping event to gain access to the object representation of the .HBM XML files. | |
This event allows you to modify any properties at runtime before the NHibernate Session Factory is created. This also makes the FluentNHibernate-equivalent convention unnecessary. Unfortunately there is currently no official documentation around this really great feature. | |
Here's a global solution to duplicate mapping problems ( Just remember that all HQL queries will now need to use Fully Qualified Type names instead of just the class names ). | |
*/ |
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.Diagnostics; | |
using System.Threading; | |
using Nano.Web.Core; | |
using Nano.Web.Core.Host.HttpListener; | |
namespace NanoWindowsServiceExample | |
{ | |
public 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
/// <summary> | |
/// Provides a means of getting/storing data in the host application's | |
/// appropriate context. | |
/// </summary> | |
/// <remarks> | |
/// For ASP.NET applications, it will store in the data in the current HTTPContext. | |
/// For all other applications, it will store the data in the logical call context. | |
/// </remarks> | |
public static class ContextStorage | |
{ |
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.Diagnostics; | |
namespace PDFMerger.Helpers | |
{ | |
public static class StopwatchHelper | |
{ | |
/// <summary> | |
/// Returns the elapsed time of the stopwatch in a formatted string. | |
/// </summary> |
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 DoubleBracketedTokenHelper | |
{ | |
public Dictionary<string, string> TokensAndValues = new Dictionary<string, string>(); | |
/// <summary> | |
/// Tokens to ignore. | |
/// </summary> | |
public List<string> IgnoredTokens = new List<string> { "{{cr}}" }; | |
// This finds any characters in between open and closing double brackets |
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.Globalization; | |
using System.Text.RegularExpressions; | |
namespace Utilities | |
{ | |
/// <summary> | |
/// Provides intelligent capitalization methods. | |
/// </summary> | |
public static class CapitalizationHelper |
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
param($installPath, $toolsPath, $package, $project) | |
# open splash page on package install | |
# don't open if it is installed as a dependency | |
# attribution: Modified from: https://github.com/JamesNK/Newtonsoft.Json/blob/master/Build/install.ps1 | |
try | |
{ | |
$url = "http://randyburden.com/Slapper.AutoMapper/" | |
$packageName = "slapper.automapper" |
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 string GetConnectionString( string connectionStringName, string applicationName ) | |
{ | |
var connectionString = ConfigurationManager.ConnectionStrings[ connectionStringName ]; | |
var builder = new System.Data.SqlClient.SqlConnectionStringBuilder( connectionString ); | |
// Inject application name into connection string | |
if ( String.IsNullOrWhiteSpace( builder.ApplicationName ) ) | |
{ | |
if ( String.IsNullOrWhiteSpace( applicationName ) == false ) |
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.Data; | |
using System.Linq; | |
using System.Reflection; | |
using NUnit.Framework; | |
namespace Atcs.Core.Tests | |
{ | |
[TestFixture] |
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.ObjectModel; | |
using System.ServiceModel; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
namespace Utilities.Wcf.Interceptors | |
{ | |
/// <summary> |