alexmen

专注.net软件开发,项目管理体系PMBOK.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Reflection" #>
<#@ output extension=".cs" #>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
namespace MyProject
{
<#
EnvDTE.DTE dte = (EnvDTE.DTE) ((IServiceProvider) this.Host)
                       .GetService(typeof(EnvDTE.DTE));
           // Assembly assembly = Assembly.LoadFrom(@"c:\CAD.dll");
           Assembly assembly = Assembly.LoadFrom(System.IO.Path.Combine(dte.ActiveDocument.Path, @"bin\Debug\CAD.dll"));
            Type[] ts = assembly.GetTypes();
            foreach (var item in ts)
            {
            #>

                 public class <#=item.Name#> {}
                 <#
            }
            #>

}

 

posted on 2015-05-15 10:45  alexmen  阅读(1311)  评论(0编辑  收藏  举报