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
<ControlTemplate TargetType="Window" x:Key="WindowTemplate"> | |
<aero:SystemDropShadowCrome CornerRadius="10" Margin="10"> | |
<Border BorderThickness="1" BorderBrush="Black" Background="White" | |
CornerRadius="10"> | |
<Border Height="40" Background="#01000000" VerticalAlignment="Top" | |
CornerRadius="10,10,0,0" MouseLeftButtonDown="DragWindow"> | |
<ContentPresenter /> | |
</Border> | |
</Border> | |
</aero:SystemDropShadowCrome> |
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
<Window x:Class="CustomWindow.Window1" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" | |
Title="Window1" Height="300" Width="300"> | |
<Grid> | |
</Grid> | |
</Window> |
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
// This: | |
session.CreateCriteria( typeof( MyClass ) ).Add( Expression.Eq( "Name", name ) ); | |
// Becomes this: | |
session.CreateCriteria( typeof( MyClass ) ).Add<MyClass>( m => m.Name == name ).List(); |
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 ColorUserType : IUserType | |
{ | |
public object Assemble( object cached, object owner ) | |
{ | |
return cached; | |
} | |
public object DeepCopy( object value ) | |
{ | |
return value; |
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 static class ColorExtensions | |
{ | |
/// <summary> | |
/// Tints the color by the given percent. | |
/// </summary> | |
/// <param name="color">The color being tinted.</param> | |
/// <param name="percent">The percent to tint. Ex: 0.1 will make the color 10% lighter.</param> | |
/// <returns>The new tinted color.</returns> | |
public static Color Lighten( this Color color, float percent ) | |
{ |
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
var proxy = new MyProxy(); | |
try | |
{ | |
// Do some work. | |
proxy.Close(); | |
} | |
catch( CommunicationException ex ) | |
{ | |
proxy.Abort(); | |
} |
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
[DeploymentItem( @"..\References\NHibernate\NHibernate.ByteCode.LinFu.dll" )] |
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
protected void Application_Error( object sender, EventArgs e ) | |
{ | |
var exception = Server.GetLastError(); | |
Response.Clear(); | |
var httpException = exception as HttpException; | |
var routeData = new RouteData(); | |
routeData.Values.Add( "controller", "Error" ); |
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
<use file="MyPartialView" /> |
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.Drawing; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
public class ScreenShot | |
{ | |
[ComImport] | |
[InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] | |
[Guid( "0000010d-0000-0000-C000-000000000046" )] |