golang实现tcp反代/转发

package main

import (
    "bytes"
    "flag"
    "io"
    "log"
    "net"
    "os"
    "strings"
    "time"
)

type formatter struct {
    w      io.Writer
    offset uint
    prefix string
    tstamp bool
}

func min(a, b int) int {
    if a < b {
        return a
    }

    return b
}

func (f *formatter) Write(p []byte) (int, error) {
    var completedBytes int
    for i := 0; i < len(p); i += 16 {
        m := min(len(p), i+16)
        err := f.format(p[i:m])
        if err != nil {
            return completedBytes, err
        }
        completedBytes += m - i
        f.offset += uint(m - i)
    }
    return len(p), nil
}

var hex = []byte("0123456789abcdef")

func (f *formatter) format(buf []byte) error {

    // prefix addr:_(hex dump)+spaces+space+bar+chars+bar+newline

    // our line is 83 characters of formatting

    plen := len(f.prefix)

    if f.tstamp {
        plen += len(time.Stamp)
    }

    llen := 83 + plen

    ptr := 0

    line := make([]byte, llen)
    if f.tstamp {
        s := time.Now().Format(time.Stamp)
        copy(line, []byte(s))
        ptr += len(time.Stamp)
    }

    copy(line[ptr:], []byte(f.prefix))
    ptr += len(f.prefix)

    offs := f.offset

    ptr += 8

    line[ptr] = ':'
    ptr--

    for offs > 0 {
        line[ptr] = hex[offs&0x0f]
        ptr--
        offs >>= 4
    }

    for ptr >= plen {
        line[ptr] = '0'
        ptr--
    }

    ptr = plen + 9
    line[ptr] = ' '
    ptr++

    for i, b := range buf {
        if i%4 == 0 {
            line[ptr] = ' '
            ptr++
        }

        line[ptr] = hex[b>>4]
        ptr++
        line[ptr] = hex[b&0x0f]
        ptr++
        line[ptr] = ' '
        ptr++

    }

    // fill in rest of line
    for i := len(buf); i < 16; i++ {
        if i%4 == 0 {
            line[ptr] = ' '
            ptr++
        }

        line[ptr] = ' '
        ptr++
        line[ptr] = ' '
        ptr++
        line[ptr] = ' '
        ptr++
    }

    line[ptr] = ' '
    ptr++
    line[ptr] = ' '
    ptr++
    line[ptr] = '|'
    ptr++

    for _, v := range buf {
        if v > 32 && v < 127 {
            line[ptr] = v
        } else {
            line[ptr] = '.'
        }
        ptr++
    }

    line[ptr] = '|'
    ptr++

    line[ptr] = '\n'
    ptr++

    _, err := f.w.Write(line[:ptr])
    return err
}

func copyStream(conn io.WriteCloser, r io.Reader) {
    _, err := io.Copy(conn, r)
    if err != nil {
        log.Printf("error during copy: %v\n", err)
    }
    err = conn.Close()
    if err != nil {
        log.Printf("error during close: %v\n", err)
    }
}

func main() {

    proxy := flag.String("p", "9999:blog.bbzhh.com:80", "proxy line -- <lport>:<rhost>:<rport>")
    tstamps := flag.Bool("t", false, "add time-stamps when proxying")
    debug := flag.Bool("d", false, "print debug information when proxying")

    flag.Parse()

    // provided a proxy line
    if *proxy != "" {
        pieces := strings.Split(*proxy, ":")
        dst := pieces[1] + ":" + pieces[2]

        fprefix := "<= "
        tprefix := "=> "

        if *tstamps {
            fprefix = " <= "
            tprefix = " => "
        }
        var (
            fin  io.Writer
            fout io.Writer
        )
        if *debug {
            fin = &formatter{os.Stdout, 0, fprefix, *tstamps}
            fout = &formatter{os.Stdout, 0, tprefix, *tstamps}
        } else {
            buf := bytes.NewBuffer(make([]byte, 0))
            fin = &formatter{buf, 0, fprefix, *tstamps}
            fout = &formatter{buf, 0, tprefix, *tstamps}
        }

        ln, e := net.Listen("tcp", ":"+pieces[0])
        if e != nil {
            log.Fatal("listen error:", e)
        }

        log.Println("tcp server starting")

        for {
            lconn, err := ln.Accept()
            if err != nil {
                log.Println(err)
                continue
            }

            go func(lconn net.Conn) {
                tl := io.TeeReader(lconn, fout)
                rconn, err := net.Dial("tcp", dst)
                if err != nil {
                    log.Println("error connectiong to", dst, ":", err)
                    err := lconn.Close()
                    if err != nil {
                        log.Printf("error closing connection: %v\n", err)
                    }
                    return
                }
                tr := io.TeeReader(rconn, fin)
                go copyStream(rconn, tl)
                go copyStream(lconn, tr)
            }(lconn)
        }
    }

    if *tstamps {
        log.Println("-t only applies when proxying, ignoring")
    }

    fout := &formatter{os.Stdout, 0, "", false}

    var fin io.Reader

    // process stdin
    if flag.NArg() == 0 {
        fin = os.Stdin
    } else {
        fname := flag.Arg(0)
        var err error
        fin, err = os.Open(fname)
        if err != nil {
            log.Fatal(err)
            return
        }
    }

    _, err := io.Copy(fout, fin)
    if err != nil {
        log.Printf("error during copy: %v\n", err)
    }
}

tornado微信公众号

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

__author__ = 'tan9le'

import os
from wechatpy import parse_message, create_reply
from wechatpy.utils import check_signature
from wechatpy.exceptions import (
    InvalidSignatureException,
)
import schedule
from datetime import timedelta
import tornado.wsgi
from tornado.options import define, options

TOKEN = os.getenv('WECHAT_TOKEN', '填写token')
AES_KEY = os.getenv('WECHAT_AES_KEY', '填写EncodingAESKey(消息加解密密钥)')
APPID = os.getenv('WECHAT_APPID', '填写AppID(应用ID)')

define("port", default=8000, help="run on the given port", type=int)
class WeiXinHandler(tornado.web.RequestHandler):
    #用于微信公众号网页修改基本信息时的验证
    def get(self):
        # 获取微信公众平台发送的验证参数
        signature = self.get_argument('signature', '')
        timestamp = self.get_argument('timestamp', '')
        nonce = self.get_argument('nonce', '')
        echostr = self.get_argument('echostr', '')
        try:
            check_signature(TOKEN, signature, timestamp, nonce)
        except InvalidSignatureException:
            self.set_stauts('403')
            self.write('error,code 403')
        #按照约定,如果正常,则原样返回echostr
        self.write(echostr)
    def post(self):
        # 获取微信公众平台发送的验证参数
        signature = self.get_argument('signature', '')
        timestamp = self.get_argument('timestamp', '')
        nonce = self.get_argument('nonce', '')
        echostr = self.get_argument('echostr', '')
        # 获取所有值并解析
        msg = parse_message(self.request.body)
        if msg.type == 'text':
            content = msg.content.strip()
            
            reply = create_reply(content, msg)
            self.write(reply.render())
        else:
            help_str = "目前仅支持文字输入\n"
            reply = create_reply(help_str, msg)
            self.write(reply.render())




app = tornado.wsgi.WSGIApplication([
    # 这里需要根据修改为自己的URL匹配
    (r"/", WeiXinHandler),

])

if __name__=="__main__":
    # 启动tornado实例
    tornado.options.parse_command_line()
    http_server = tornado.httpserver.HTTPServer(app)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()

然后使用

python main.py --port=8000

就可以启动应用啦
依赖:

tornado
wechatpy

windows上自动设置java环境变量的脚本

@echo off

:: TODO:设置java环境变量
:: Author: Gwt
color 02
::设置java的安装路径,可方便切换不同的版本
set input=
set /p "input=请输入java的jdk路径(或回车默认路径为C:\Program Files\Java\jdk1.7.0_71):"
if defined input (echo jdk已设置) else (set input=C:\Program Files\Java\jdk1.7.0_71)
echo jdk路径为%input%
set javaPath=%input%

::如果有的话,先删除JAVA_HOME
wmic ENVIRONMENT where "name='JAVA_HOME'" delete

::如果有的话,先删除ClASS_PATH 
wmic ENVIRONMENT where "name='CLASS_PATH'" delete

::创建JAVA_HOME
wmic ENVIRONMENT create name="JAVA_HOME",username="<system>",VariableValue="%javaPath%"

::创建CLASS_PATH
wmic ENVIRONMENT create name="CLASS_PATH",username="<system>",VariableValue=".;%%JAVA_HOME%%\lib\tools.jar;%

%JAVA_HOME%%\lib\dt.jar;"

::在环境变量path中,剔除掉变量java_home中的字符,回显剩下的字符串
call set xx=%Path%;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin

::echo %xx%

::将返回显的字符重新赋值到path中
wmic ENVIRONMENT where "name='Path' and username='<system>'" set VariableValue="%xx%"

pause

解释下命令

   @echo off 是关闭回显的,不会显示命令信息 on打开会显示命令信息

  color 02是设置输出文本颜色的,这里是控制命令台输出绿颜色

  set /p "input=请输入命令信息" 是用来接收控制台输入的文本信息的

  if else 是用来做判断 if defined input 是用来判断用户是否输入信息,回车的话,则表示未定义input的值

  echo "输出信息" 是用来显示信息的

  set javaPath=%input% 是用来吧变量input的值赋值给javaPath变量的

  wmic 是提供了批处理的命令,可以方便的操作环境变量值

  删除某一环境变量 就使用 wmic ENVIRONMENT where "name='JAVA_HOME'" delete命令

  创建某一环境变量 使用 wmic ENVIRONMENT create name="JAVA_HOME",username="<system>",VariableValue="%javaPath%"命令

      修改某一环境变量 使用 wmic ENVIRONMENT where "name='Path' and username='<system>'" set VariableValue="value"

注意事项:

  1、在上述批处理脚本命令中,要严格注意空格和大小写等的输入,不然执行不成功的

  2、要以管理员方式运行命令,不然提示拒绝执行命令的提示

解决MacOS下readlink: illegal option -- f

Mac下的readlink没有-f参数,诸如screenfetch又会去调用readlink -f,于是每次都会出现:

readlink: illegal option -- f
usage: readlink [-n] [file ...]

很是烦人,解决方案如下:
1.安装coreutils:

brew install coreutils

2.设置环境变量,编辑~/.bash_profile,添加:

export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

3.创建别名,使用greadlink替代readlink,同样是编辑~/.bash_profile,添加:

alias readlink=greadlink

C# JSON工具类

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Linq;
using System.Web.Script.Serialization;
using System.Collections;

namespace WindowsFormsTestApp1
{
    public class JsonConverter
    {

        /// <summary>
        /// 自定义查询对象转换动态类
        /// add yuangang by 2015-05-19
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static dynamic JsonClass(object obj)
        {
            return ConvertJson(Serialize(obj, true));
        }

        /// <summary>
        /// object动态类转换json包
        /// add yuangang by 2015-05-19
        /// </summary>
        /// <param name="obj">对象</param>
        /// <param name="DateConvert">时间戳是否转换成日期类型</param>
        /// <returns></returns>
        public static string Serialize(object obj, bool DateConvert = false)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();
            var str = jss.Serialize(obj);
            if (DateConvert)
            {
                str = System.Text.RegularExpressions.Regex.Replace(str, @"\\/Date\((\d+)\)\\/", match =>
                {
                    DateTime dt = new DateTime(1970, 1, 1);
                    dt = dt.AddMilliseconds(long.Parse(match.Groups[1].Value));
                    dt = dt.ToLocalTime();
                    return dt.ToString("yyyy-MM-dd HH:mm:ss");
                });
            }
            return str;
        }

        /// <summary>
        /// json转换object动态类
        /// add yuangang by 2015-05-19
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public static dynamic ConvertJson(string json)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();
            jss.RegisterConverters(new JavaScriptConverter[] { new DynamicJsonConverter() });
            dynamic dy = jss.Deserialize(json, typeof(object)) as dynamic;
            return dy;
        }

        /// <summary>  
        /// DataReader转换为Json  
        /// </summary>  
        /// <param name="dataReader">DataReader对象</param>  
        /// <returns>Json字符串</returns>  
        public static string ToJson(IDataReader dataReader)
        {
            try
            {
                StringBuilder jsonString = new StringBuilder();
                jsonString.Append("[");

                while (dataReader.Read())
                {
                    jsonString.Append("{");
                    for (int i = 0; i < dataReader.FieldCount; i++)
                    {
                        Type type = dataReader.GetFieldType(i);
                        string strKey = dataReader.GetName(i);
                        string strValue = dataReader[i].ToString();
                        jsonString.Append("\"" + strKey + "\":");
                        strValue = StringFormat(strValue, type);
                        if (i < dataReader.FieldCount - 1)
                        {
                            jsonString.Append(strValue + ",");
                        }
                        else
                        {
                            jsonString.Append(strValue);
                        }
                    }
                    jsonString.Append("},");
                }
                if (!dataReader.IsClosed)
                {
                    dataReader.Close();
                }
                jsonString.Remove(jsonString.Length - 1, 1);
                jsonString.Append("]");
                if (jsonString.Length == 1)
                {
                    return "[]";
                }
                return jsonString.ToString();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>  
        /// DataSet转换为Json  
        /// add yuangang by 2015-05-19
        /// </summary>  
        /// <param name="dataSet">DataSet对象</param>  
        /// <returns>Json字符串</returns>  
        public static string ToJson(DataSet dataSet)
        {
            string jsonString = "{";
            foreach (DataTable table in dataSet.Tables)
            {
                jsonString += "\"" + table.TableName + "\":" + ToJson(table) + ",";
            }
            jsonString = jsonString.TrimEnd(',');
            return jsonString + "}";
        }
        /// <summary> 
        /// DataTable转成Json  
        /// add yuangang by 2015-05-19
        /// </summary> 
        /// <param name="jsonName"></param> 
        /// <param name="dt"></param> 
        /// <returns></returns> 
        public static string ToJson(DataTable dt, string jsonName)
        {
            StringBuilder Json = new StringBuilder();
            if (string.IsNullOrEmpty(jsonName))
                jsonName = dt.TableName;
            Json.Append("{\"" + jsonName + "\":[");
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Json.Append("{");
                    for (int j = 0; j < dt.Columns.Count; j++)
                    {
                        Type type = dt.Rows[i][j].GetType();
                        Json.Append("\"" + dt.Columns[j].ColumnName.ToString() + "\":" + StringFormat(dt.Rows[i][j] is DBNull ? string.Empty : dt.Rows[i][j].ToString(), type));
                        if (j < dt.Columns.Count - 1)
                        {
                            Json.Append(",");
                        }
                    }
                    Json.Append("}");
                    if (i < dt.Rows.Count - 1)
                    {
                        Json.Append(",");
                    }
                }
            }
            Json.Append("]}");
            return Json.ToString();
        }
        /// <summary>  
        /// Datatable转换为Json  
        /// add yuangang by 2015-05-19
        /// </summary>  
        /// <param name="table">Datatable对象</param>  
        /// <returns>Json字符串</returns>  
        public static string ToJson(DataTable dt)
        {
            StringBuilder jsonString = new StringBuilder();
            jsonString.Append("[");
            DataRowCollection drc = dt.Rows;
            for (int i = 0; i < drc.Count; i++)
            {
                jsonString.Append("{");
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    string strKey = dt.Columns[j].ColumnName;
                    string strValue = drc[i][j].ToString();
                    Type type = dt.Columns[j].DataType;
                    jsonString.Append("\"" + strKey + "\":");
                    strValue = StringFormat(strValue, type);
                    if (j < dt.Columns.Count - 1)
                    {
                        jsonString.Append(strValue + ",");
                    }
                    else
                    {
                        jsonString.Append(strValue);
                    }
                }
                jsonString.Append("},");
            }
            jsonString.Remove(jsonString.Length - 1, 1);
            jsonString.Append("]");
            if (jsonString.Length == 1)
            {
                return "[]";
            }
            return jsonString.ToString();
        }
        /// <summary> 
        /// 格式化字符型、日期型、布尔型 
        /// add yuangang by 2015-05-19
        /// </summary> 
        /// <param name="str"></param> 
        /// <param name="type"></param> 
        /// <returns></returns> 
        private static string StringFormat(string str, Type type)
        {
            if (type != typeof(string) && string.IsNullOrEmpty(str))
            {
                str = "\"" + str + "\"";
            }
            else if (type == typeof(string))
            {
                str = String2Json(str);
                str = "\"" + str + "\"";
            }
            else if (type == typeof(DateTime))
            {
                str = "\"" + str + "\"";
            }
            else if (type == typeof(bool))
            {
                str = str.ToLower();
            }
            else if (type == typeof(byte[]))
            {
                str = "\"" + str + "\"";
            }
            else if (type == typeof(Guid))
            {
                str = "\"" + str + "\"";
            }
            return str;
        }
        /// <summary> 
        /// 过滤特殊字符 
        /// add yuangang by 2015-05-19
        /// </summary> 
        /// <param name="s"></param> 
        /// <returns></returns> 
        public static string String2Json(String s)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < s.Length; i++)
            {
                char c = s.ToCharArray()[i];
                switch (c)
                {
                    case '\"':
                        sb.Append("\\\""); break;
                    case '\\':
                        sb.Append("\\\\"); break;
                    case '/':
                        sb.Append("\\/"); break;
                    case '\b':
                        sb.Append("\\b"); break;
                    case '\f':
                        sb.Append("\\f"); break;
                    case '\n':
                        sb.Append("\\n"); break;
                    case '\r':
                        sb.Append("\\r"); break;
                    case '\t':
                        sb.Append("\\t"); break;
                    case '\v':
                        sb.Append("\\v"); break;
                    case '\0':
                        sb.Append("\\0"); break;
                    default:
                        sb.Append(c); break;
                }
            }
            return sb.ToString();
        }

        public static string GetDataGridJsonByDataSet(DataSet ds, string totalProperty, string root)
        {
            return GetDataGridJsonByDataTable(ds.Tables[0], totalProperty, root);
        }
        public static string GetDataGridJsonByDataTable(DataTable dt, string totalProperty, string root)
        {
            StringBuilder jsonBuilder = new StringBuilder();
            jsonBuilder.Append("({\"" + totalProperty + "\":\"" + dt.Rows.Count + "\",");
            jsonBuilder.Append("\"");
            jsonBuilder.Append(root);
            jsonBuilder.Append("\":[");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                jsonBuilder.Append("{");
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(dt.Columns[j].ColumnName);
                    jsonBuilder.Append("\":\"");
                    jsonBuilder.Append(dt.Rows[i][j].ToString());
                    jsonBuilder.Append("\",");
                }
                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("},");
            }
            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
            jsonBuilder.Append("]");
            jsonBuilder.Append("})");
            return jsonBuilder.ToString();
        }

        public static string GetTreeJsonByDataSet(DataSet ds)
        {
            return GetTreeJsonByDataTable(ds.Tables[0]);
        }
        public static string GetTreeJsonByDataTable(DataTable dataTable)
        {
            DataTable dt = FormatDataTableForTree(dataTable);
            StringBuilder jsonBuilder = new StringBuilder();
            jsonBuilder.Append("[");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                jsonBuilder.Append("{");
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    jsonBuilder.Append("\'");

                    if (dt.Columns[j].ColumnName == "leaf")
                    {
                        string leafValue = dt.Rows[i][j].ToString();

                        if (!string.IsNullOrEmpty(leafValue))
                        {
                            jsonBuilder.Append(dt.Columns[j].ColumnName);
                            jsonBuilder.Append("\':\'");
                            jsonBuilder.Append(dt.Rows[i][j].ToString());
                            jsonBuilder.Append("\',");
                        }
                        else
                        {
                            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                        }
                    }
                    else if (dt.Columns[j].ColumnName == "customUrl")
                    {
                        jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                        jsonBuilder.Append(dt.Columns[j].ColumnName);
                        jsonBuilder.Append(":\'");
                        jsonBuilder.Append(dt.Rows[i][j].ToString());
                        jsonBuilder.Append("\',");
                    }
                    else
                    {
                        jsonBuilder.Append(dt.Columns[j].ColumnName);
                        jsonBuilder.Append("\':\'");
                        jsonBuilder.Append(dt.Rows[i][j].ToString());
                        jsonBuilder.Append("\',");
                    }

                }
                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("},");
            }
            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
            jsonBuilder.Append("]");
            return jsonBuilder.ToString();
        }
        private static DataTable FormatDataTableForTree(DataTable dt)
        {
            DataTable dtTree = new DataTable();
            dtTree.Columns.Add("id", typeof(string));
            dtTree.Columns.Add("text", typeof(string));
            dtTree.Columns.Add("leaf", typeof(string));
            dtTree.Columns.Add("cls", typeof(string));
            dtTree.Columns.Add("customUrl", typeof(string));
            dtTree.AcceptChanges();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow drTree = dtTree.NewRow();
                drTree["id"] = dt.Rows[i]["id"].ToString();
                drTree["text"] = dt.Rows[i]["text"].ToString();
                if (dt.Rows[i]["leaf"].ToString() == "Y")
                {
                    drTree["leaf"] = "true";
                    drTree["cls"] = "file";
                }
                else
                {
                    drTree["cls"] = "folder";
                }
                drTree["customUrl"] = dt.Rows[i]["customUrl"].ToString();
                dtTree.Rows.Add(drTree);
            }
            return dtTree;
        }

    }
    /// <summary>
    /// 动态JSON解析
    /// add yuangang by 2015-05-19
    /// </summary>
    public class DynamicJsonObject : System.Dynamic.DynamicObject
    {
        private IDictionary<string, object> Dictionary { get; set; }

        public DynamicJsonObject(IDictionary<string, object> dictionary)
        {
            this.Dictionary = dictionary;
        }

        public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out object result)
        {
            result = this.Dictionary[binder.Name];

            if (result is IDictionary<string, object>)
            {
                result = new DynamicJsonObject(result as IDictionary<string, object>);
            }
            else if (result is ArrayList && (result as ArrayList) is IDictionary<string, object>)
            {
                result = new List<DynamicJsonObject>((result as ArrayList).ToArray().Select(x => new DynamicJsonObject(x as IDictionary<string, object>)));
            }
            else if (result is ArrayList)
            {
                result = new List<object>((result as ArrayList).ToArray());
            }

            return this.Dictionary.ContainsKey(binder.Name);
        }
    }
    /// <summary>
    /// 动态JSON转换
    /// add yuangang by 2015-05-19
    /// </summary>
    public class DynamicJsonConverter : JavaScriptConverter
    {
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary == null)
                throw new ArgumentNullException("dictionary");

            if (type == typeof(object))
            {
                return new DynamicJsonObject(dictionary);
            }

            return null;
        }

        public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            throw new NotImplementedException();
        }

        public override IEnumerable<Type> SupportedTypes
        {
            get { return new System.Collections.ObjectModel.ReadOnlyCollection<Type>(new List<Type>(new Type[] { typeof(object) })); }
        }
    }
}