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
<?xml version="1.0" encoding="utf-8"?>
<log4net debug="false">
<appender name="file-appender" type="log4net.Appender.FileAppender+MinimalLock">
<file value="log-file.txt" />
<appendToFile value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
@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>
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
@huoxudong125
huoxudong125 / WPF ComboBox Style.xml
Last active April 20, 2022 13:08 — forked from hansmaad/gist:9187633
WPF Flat Combo Box Style
<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>
@huoxudong125
huoxudong125 / TextBox.xaml
Last active August 29, 2015 14:26 — forked from Javad-Amiry2/TextBox.xaml
WPF TextBox style and control template sample
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- defining some colors to use in our template and style section -->
<Color x:Key="ControlForeground">#181818</Color>
<Color x:Key="ControlReadOnlyForeground">#383838</Color>
<Color x:Key="ControlDisabledForeground">#686868</Color>
<Color x:Key="ControlBackground">#f7f7f9</Color>
<Color x:Key="ControlHoveredBackground">#fafafc</Color>
@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,
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;