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
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
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
// 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
<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
<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
<aero:SystemDropShadowChrome CornerRadius="10" Margin="10"> | |
<Border BorderThickness="1" BorderBrush="Black" Background="White" | |
Margin="0" CornerRadius="10"> | |
<Grid> | |
<Border Height="40" Background="#01000000" VerticalAlignment="Top" | |
CornerRadius="10,10,0,0" MouseLeftButtonDown="DragWindow" /> | |
<Rectangle x:Name="ResizeN" Fill="Yellow" VerticalAlignment="Top" | |
Height="4" Margin="9,-2,9,0" MouseEnter="DisplayResizeCursor" | |
MouseLeave="ResetCursor" PreviewMouseLeftButtonDown="Resize" /> | |
<Rectangle x:Name="ResizeE" Fill="Yellow" HorizontalAlignment="Right" |
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 uri = new Uri( string.Format( "{0}?unique={1}", "SamePage.xaml, Guid.NewGuid() ), UriKind.RelativeOrAbsolute ); | |
RemoveBackEntry = true; | |
NavigationService.Navigate( uri ); |
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 Irony.Parsing; | |
namespace Irony.Samples.SQLite | |
{ | |
[Language( "SQLite", "3", "SQLite Grammar" )] | |
// ReSharper disable once InconsistentNaming | |
public class SQLiteGrammar : Grammar | |
{ | |
public SQLiteGrammar() : base( 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
Id | Name | |
---|---|---|
1 | one | |
2 | two |