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
In your XAML: | |
------------- | |
<RichTextBox | |
Name="MyRichTextBox" | |
PreviewKeyDown="MyRichTextBox_PreviewKeyDown" /> | |
In your C# Code-behind: | |
----------------------- |
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
/*! | |
* Fluent Table Cells - An easily extendible fluent interface for programmatically creating table cells in JavaScript. | |
* Author: Randy Burden | |
* http://www.randyburden.com | |
* Open Source Url: https://gist.github.com/2629702 | |
* | |
* Example usage: | |
var row = '<tr>'; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<!-- Stylesheets --> | |
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/smoothness/jquery-ui.css" > | |
<style type="text/css"> | |
body { font-family: Arial, Sans-Serif; font-size: 12pt; } |
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 FluentNHibernate.Cfg; | |
using FluentNHibernate.Cfg.Db; | |
using NHibernate; | |
using NHibernate.Cfg; | |
/// <summary> | |
/// NHibernate Helper | |
/// </summary> | |
/// <remarks> | |
/// Because the SessionFactory creation is lazy-loaded, you technically never need to bootstrap NHibernate |
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
Adding Yourself as SQL Server Express SysAdmin | |
---------------------------------------------- | |
Problem: | |
The help desk installs SQL Server on our developer machines under their own user accounts meaning you aren't a | |
sysadmin on your own SQL Server Express instance which in turn means you can't create a new database. | |
Solution: |
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
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> |
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 |
OlderNewer