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
// Complementary to http://gist.github.com/406014. Just swap your BDD<T> base class for DBDD | |
// Also licensed under MSPL/FreeBSD/ISC | |
public abstract class DBDD | |
{ | |
public readonly dynamic Given; | |
public readonly dynamic When; | |
public readonly dynamic Then; | |
public readonly dynamic And; |
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.IO; | |
using System.Linq; | |
namespace Regionator | |
{ | |
public class Program | |
{ | |
const int TargetSpacesPerIndent = 3; |
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 CodeTimer : IDisposable | |
{ | |
private readonly string _message; | |
private readonly Stopwatch _sw = new Stopwatch(); | |
public CodeTimer(string message) | |
{ | |
_message = message; | |
_sw.Start(); | |
} |
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 Extensions | |
{ | |
public static IObservable<TProperty> ObservePropertyChanged<TNotifier, TProperty>( | |
this TNotifier notifier, | |
Expression<Func<TNotifier, TProperty>> propertyAccessor, | |
bool startWithCurrent = false) | |
where TNotifier : INotifyPropertyChanged | |
{ | |
// Parse the expression to find the correct property name. |
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 FillingLine : Path | |
{ | |
Size lastFinalSize; | |
protected override Size MeasureOverride(Size availableSize) | |
{ | |
return new Size(0, 0); | |
} | |
protected override Size ArrangeOverride(Size finalSize) |
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
<#@ template debug="false" hostspecific="true" language="C#" #> | |
<#@ output extension="Generated.cs" #> | |
<#@ assembly name="System.Core" #> | |
<#/* Modify the following assembly reference(s) to include the classes you are interested in: */#> | |
<#@ assembly name="c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Xml.dll" #> | |
<#@ import namespace="System.Reflection" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Runtime.Remoting.Messaging" #> |
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.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
namespace ReferenceReader | |
{ |
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
<#@ template debug="false" hostspecific="false" language="C#" #> | |
<#@ output extension="Generated.cs" #> | |
<#@ assembly name="System.Core" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Runtime.Remoting.Messaging" #> | |
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #> | |
using System; | |
using System.Linq; | |
using System.Reactive; | |
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> | |
/// Easy way to switch between no content template and some content template in silverlight | |
/// Helps you to keep the number of visuals in your visual tree down. | |
/// </summary> | |
public class VirtualContentPresenter : ContentPresenter | |
{ | |
public static readonly DependencyProperty VirtualContentTemplateProperty = DependencyProperty.Register("VirtualContentTemplate", | |
typeof(DataTemplate), | |
typeof(VirtualContentPresenter), | |
new PropertyMetadata(null, (o, args) => ((VirtualContentPresenter) o).VirtualContentPropertyChanged())); |
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
<#@ template language="C#" hostspecific="True" debug="True" #> | |
<#@ import namespace="System.IO"#> | |
<#@ import namespace="System.Linq"#> | |
<#@ import namespace="System.Collections.Generic"#> | |
<#@ import namespace="System.Runtime.Remoting.Messaging" #> | |
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #> | |
<#@ assembly name="System.Core.dll"#> | |
<#@ output extension=".Generated.cs" #> | |
<# |
OlderNewer