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
using System;
using System.IO;
namespace App
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(@"D:\");
#include <windows.h>
#include <string>
#include <vector>
#include <stack>
#include <iostream>
#include <map>
#include <regex>
using namespace std;
bool IsExistDirectory(const std::wstring& dirName_in)
{
DWORD ftyp = GetFileAttributes(dirName_in.c_str());
if (ftyp == INVALID_FILE_ATTRIBUTES)
return false; //something is wrong with your path!
if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
return true; // this is a directory!
return false; // this is not a directory!
//! Byte swap unsigned short
static uint16_t swap_uint16(uint16_t val)
{
return (val << 8) | (val >> 8);
}
//! Byte swap short
static int16_t swap_int16(int16_t val)
{
return (val << 8) | ((val >> 8) & 0xFF);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace UserCtrl
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
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)
{
@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 / XmlHelper
Created September 2, 2015 02:29
A C# helper to read and write XML from and to objects
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.
@huoxudong125
huoxudong125 / XML Serialization Output
Last active September 2, 2015 02:30
.NET/C# XML Serialization: Generic Helper for Loading/Saving
<?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>