Skip to content

Instantly share code, notes, and snippets.

View huoxudong125's full-sized avatar
💭
I may be slow to respond.

Frank Huo huoxudong125

💭
I may be slow to respond.
View GitHub Profile
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="ScrollBarThumb"
TargetType="{x:Type Thumb}">
<Setter Property="OverridesDefaultStyle"
Value="true"/>
<Setter Property="IsTabStop"
Value="false"/>
@huoxudong125
huoxudong125 / MetroButton
Last active September 2, 2015 02:38 — forked from alimbada/gist:3083937
MetroButton For WPF
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="ButtonFocusVisual">
<Setter
Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2" />
</ControlTemplate>
@huoxudong125
huoxudong125 / JsonHelpers.cs
Created September 2, 2015 02:49
JsonHelpers using Newtonsoft.Json;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Bleroy
{
public static class JsonHelpers
{
/// <summary>
/// Advances the reader to the first child property with the provided name,
/// no matter how deep it is.
@huoxudong125
huoxudong125 / VerticalProgressBarStyles.xaml
Last active September 2, 2015 03:06 — forked from markheath/VerticalProgressBarStyles.xaml
WPF Vertical Progress Bar Styles
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<Style TargetType="ProgressBar" x:Key="Basic">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ProgressBar" >
<Grid x:Name="Root">
<Border
@huoxudong125
huoxudong125 / AudioPlaybackEngine.cs
Last active September 2, 2015 03:15 — forked from markheath/AudioPlaybackEngine.cs
FireAndForget NAudio Sample
using System;
using NAudio.Wave;
using NAudio.Wave.SampleProviders;
namespace FireAndForgetAudioSample
{
class AudioPlaybackEngine : IDisposable
{
private readonly IWavePlayer outputDevice;
private readonly MixingSampleProvider mixer;
@huoxudong125
huoxudong125 / DelayFadeOutSampleProvider.cs
Last active September 2, 2015 03:28 — forked from markheath/DelayFadeOutSampleProvider.cs
NAudio basic example of how to begin a fade out after a certain number of milliseconds have elapsed
// Define other methods and classes here
/// <summary>
/// Sample Provider to allow fading in and out
/// </summary>
public class DelayFadeOutSampleProvider : ISampleProvider
{
enum FadeState
{
Silence,
FadingIn,
public void Clone(object source, object destination, bool copyFields = true, bool copyProperties = true)
{
if (copyFields)
foreach (System.Reflection.FieldInfo field in destination.GetType().GetFields())
field.SetValue(destination, source.GetType().GetFields().First(n => n.Name == field.Name).GetValue(source));
if (copyProperties)
foreach (System.Reflection.PropertyInfo property in destination.GetType().GetProperties().Where(n => n.CanWrite))
property.SetValue(destination, source.GetType().GetProperties().First(n => n.Name == property.Name).GetValue(source, null), null);
}
function Get-VisualChildren($item) {
for ($i = 0; $i -lt [System.Windows.Media.VisualTreeHelper]::GetChildrenCount($item); $i++) {
$child = [System.Windows.Media.VisualTreeHelper]::GetChild($item, $i)
Get-VisualChildren($child)
}
$item
}
function Get-TreeItems {
Get-VisualChildren $snoopui | ? { $_.GetType().Name -eq "ProperTreeViewItem" }
@huoxudong125
huoxudong125 / MP3StreamingPanelPlugin.cs
Last active September 2, 2015 05:29 — forked from markheath/MP3StreamingPanelPlugin.cs
NAudio Demo modified to play ShoutCast (courtesy of Stephen Cole)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NAudio.Wave;
using System.Net;
using System.Threading;
@huoxudong125
huoxudong125 / gist:30b4367fd0212b0032a3
Last active September 10, 2015 03:31 — forked from Demwunz/gist:813895
XSLT HTML5 Boilerplate starter
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:func="http://exslt.org/functions"
xmlns:head="http://headjs.com"
extension-element-prefixes="exsl func head">
<xsl:import href="../utilities/page-title.xsl"/>
<xsl:import href="../utilities/navigation.xsl"/>