建立事件与回调函数之间的连接应该这样写Application.DocumentManager.DocumentActivated += new DocumentCollectionEventHandler(AddLayer),但是不知道这句话放在dll中命名空间的那个位置才能在加载dll时自动运行这句话。自己顶下,高手们帮忙解决下啊!
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using System;
[assembly: ExtensionApplication(typeof(HfkxCAD.Initialization))]
namespace HfkxCAD
{
public class Initialization : Autodesk.AutoCAD.Runtime.IExtensionApplication
{
WpfSystemSet wpf = new WpfSystemSet();
public void Initialize()
{