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.Collections.Generic; | |
using System.ComponentModel; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; | |
using Gma.QrCodeNet.Encoding; | |
namespace Gma.QrCodeNet.Wpf | |
{ | |
public class QrCodeElement : Control |
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
<Style x:Key="ShadowBorder" TargetType="ContentControl"> | |
<Setter Property="Foreground" Value="#FF000000"/> | |
<Setter Property="HorizontalContentAlignment" Value="Left"/> | |
<Setter Property="VerticalContentAlignment" Value="Top"/> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="ContentControl"> | |
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> | |
<Grid Margin="2,1,2,-3" RenderTransformOrigin="0.5,0"> | |
<Grid.RenderTransform> |
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
glob:Debug | |
glob:*.user | |
glob:_ReSharper* | |
glob:*.cachefile | |
glob:*.suo | |
glob:~$* | |
glob:*.tmp | |
glob:*/bin/* | |
glob:*/obj/* | |
glob:*.orig |
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 NodeList<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>> where TKey : IComparable<TKey> | |
{ | |
readonly Node start = new Node(default(TKey), default(TValue)); | |
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() | |
{ | |
for (Node n = start.GetNext(); n != null; n = n.GetNext()) | |
{ | |
yield return new KeyValuePair<TKey, TValue>(n.key, n.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
static string Minimize(XDocument document) | |
{ | |
//take out the comments | |
document.DescendantNodes().OfType<XComment>().Remove(); | |
//take out the mc:ignorables | |
XNamespace mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"; | |
var ignorable = document.Root.Attribute(mc + "Ignorable"); | |
if (ignorable != null) | |
{ |
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 | |
{ | |
readonly string message; | |
readonly DateTime start; | |
public CodeTimer(string message) | |
{ | |
this.message = message; | |
start = DateTime.UtcNow; | |
} |
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" #> | |
<# |
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 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
namespace ReferenceReader | |
{ |