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
private void Print(Visual v) | |
{ | |
System.Windows.FrameworkElement e = v as System.Windows.FrameworkElement ; | |
if (e == null) | |
return; | |
PrintDialog pd = new PrintDialog(); | |
if (pd.ShowDialog() == true) | |
{ |
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
<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> |
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.IO; | |
namespace App | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(@"D:\"); |
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
<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"/> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Car xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<Make>Peugeot</Make> | |
<Model>406</Model> | |
<DoorCount>3</DoorCount> | |
</Car> |
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.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Xml.Linq; | |
namespace Nwazet.Commerce.Helpers { | |
public static class XmlHelper { | |
/// <summary> | |
/// Like Add, but chainable. |
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 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. |
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
<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 |
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 NAudio.Wave; | |
using NAudio.Wave.SampleProviders; | |
namespace FireAndForgetAudioSample | |
{ | |
class AudioPlaybackEngine : IDisposable | |
{ | |
private readonly IWavePlayer outputDevice; | |
private readonly MixingSampleProvider mixer; |
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
// Define other methods and classes here | |
/// <summary> | |
/// Sample Provider to allow fading in and out | |
/// </summary> | |
public class DelayFadeOutSampleProvider : ISampleProvider | |
{ | |
enum FadeState | |
{ | |
Silence, | |
FadingIn, |