Addin

说明:

这是托管对象模型客户端插件的抽象基类。
管理的MDL应用程序加载器被提供了一个程序集名称和一个类型名称,该类型将派生自这个类。 装载器将把程序集加载到适当的领域中,构建一个指定类的实例,然后在刚刚构建的实例上调用Run方法—将load keyin的命令尾部作为一个String参数传递。 在构建过程中,该类将确保一个真正的MDL应用程序被启动,并在当前代表AddIn。 这使每个被托管的AddIn都有自己独特的MDL身份。

构造:

protected AddIn(IntPtr mdlDescriptor)

  1. protected AddIn(IntPtr mdlDescriptor)

功能说明:

构造函数

输入:

IntPtr mdlDescriptor

输出:

示例:

方法:Methods

ActivateExceptionHandler()

  1. public static void ActivateExceptionHandler();

功能说明:

输入:

输出:

示例:

DeactivateExceptionHandler();

  1. public static void DeactivateExceptionHandler();

功能说明:

输入:

输出:

示例:

FindAddInByTaskId(string taskId);

  1. public static AddIn FindAddInByTaskId(string taskId);

功能说明:

这个函数有时可能很有用,但有点不鼓励使用它。 使用这个函数来获得一个AddIn^可能会导致加载程序集到调用的AppDomain中。由于加载到默认AppDomain中的程序集不能从进程中卸载,如果调用域是默认AppDomain,这可能特别不可取。如果你想做的只是确定某个AddIn是否被加载,那么就用AddIn::IsAddInLoaded()代替。

输入:

string taskId

输出:

示例:

GetMdlTaskID(AddInAttribute addInAttribute);

  1. public static string GetMdlTaskID(AddInAttribute addInAttribute);

功能说明:

输入:

输出:

示例:

IsAddInLoaded(string taskId);

  1. public static bool IsAddInLoaded(string taskId);

Determine whether some AddIn is loaded with given taskId
确定某些taskId的AddIn是否加载。
功能说明:

输入:

输出:

示例:

Load(string[] commandTail, IntPtr mdlDesc);

  1. public static int Load(string[] commandTail, IntPtr mdlDesc);

功能说明:

输入:

输出:

示例:

LoadApplicationListByConfigVar(string cfgVarName, string firstArg, MdlApplicationType appType);

  1. public static int LoadApplicationListByConfigVar(string cfgVarName, string firstArg,
  2. MdlApplicationType appType);

通过配置文件加载应用
功能说明:

输入:

输出:

示例:

LoadAssemblyListByConfigVar(string cfgVarName, string callerID, Type attributeType, bool throwOnNotFound, params NamedArgument[] additionalArguments);

  1. public static int LoadAssemblyListByConfigVar(
  2. string cfgVarName, string callerID, Type attributeType,
  3. bool throwOnNotFound, params NamedArgument[] additionalArguments);

通过配置加载程序集
功能说明:

输入:

输出:

示例:

LoadLibraryAddIn(string pathP, string taskIdP, string pArgument);

  1. public static int LoadLibraryAddIn(string pathP, string taskIdP, string pArgument);

功能说明:

从pathP指定的资源文件中加载taskIdP指定的程序。如果pathP为NULL,新的程序将从与父任务相同的资源文件中加载。

输入:

string pathP .rsc/.ma or assembly-minus-.dll-extension string taskIdP mdl taskID if selecting from among multiple tasks in file (or nullptr if not) string pArgument command-line string

输出:

示例:

LoadLibraryAddIn(string pathP, string taskIdP, string appDomainP, string pArgument);

  1. public static int LoadLibraryAddIn(string pathP, string taskIdP, string appDomainP,
  2. string pArgument);

功能说明:

从pathP指定的资源文件中加载taskIdP指定的程序。如果pathP为NULL,新的程序将从与父任务相同的资源文件中加载。

输入:

string pathP, .rsc/.ma or assembly-minus-.dll-extension string taskIdP, mdl taskID if selecting from among multiple tasks in file (or nullptr if not) string appDomainP, nullptr to use either Default app domain or app domain specified in deployed .ma file string pArgument,command-line string

输出:

示例:

LoadUnattachedCommandTable(string fileName);

  1. public static void LoadUnattachedCommandTable(string fileName);

功能说明:

输入:

输出:

示例:

UnloadAddIn(string taskId);

  1. public static int UnloadAddIn(string taskId);

功能说明:

卸载由taskId指定的MDL程序

输入:

string taskId 要卸载的程序的名称

输出:

如果成功,返回0。否则,它将返回一个非零值

示例:

  1. UnloadAddIn(addIn.MdlTaskId);

UnloadAddIn(AddIn addIn);

  1. public static int UnloadAddIn(AddIn addIn);

功能说明:

卸载由addIn中taskId指定的MDL程序。

输入:

AddIn addIn,插件程序Addin

输出:

如果成功的话,返回0。否则,它将返回一个非零值

示例:

GetMdlDescriptor();

  1. public virtual IntPtr GetMdlDescriptor();

功能说明:

输入:

输出:

示例:

LoadAddIn(string pathP, string taskIdP, string pArgument);

  1. public int LoadAddIn(string pathP, string taskIdP, string pArgument);

功能说明:

输入:

输出:

示例:

LoadAddIn(string pathP, string taskIdP, string appDomainP, string pArgument);

  1. public int LoadAddIn(string pathP, string taskIdP, string appDomainP, string pArgument);

功能说明:

输入:

输出:

示例:

LookupCommandNumberFromKeyinString(string keyinString);

  1. public ulong LookupCommandNumberFromKeyinString(string keyinString);

功能说明:

输入:

输出:

示例:

OnUnloaded(UnloadedEventArgs eventArgs);

  1. protected virtual void OnUnloaded(UnloadedEventArgs eventArgs);

功能说明:

输入:

输出:

示例:

OnUnloading(UnloadingEventArgs eventArgs);

  1. protected virtual void OnUnloading(UnloadingEventArgs eventArgs);

功能说明:

输入:

输出:

示例:

Run(string[] commandLine)

  1. protected abstract int Run(string[] commandLine);

功能说明:

加载插件时的入口函数

输入:

string[] commandLine 命令字符

输出:

成功返回0

示例:

  1. protected override int Run(string[] commandLine)
  2. {
  3. return 0;
  4. }

字段 Fields

SystemTaskId

  1. public static string SystemTaskId;

功能说明:

输入:

输出:

示例:

属性Properties

ApplicationType

  1. public MdlApplicationType ApplicationType { get; set; }

功能说明:

获取应用类型

输入:

输出:

public enum MdlApplicationType { User = 0, Required = 1, InitApp = 2, DesignApp = 3, UIServer = 4, PlotDriver = 5, AutoDgn = 6, StayResidentServer = 7, LicenseApp = 9, RibbonProvider = 10 }

示例:

Disposables

  1. public virtual LifetimeCollection Disposables { get; }

功能说明:

输入:

输出:

示例:

MdlTaskId

  1. public virtual string MdlTaskId { get; }

Gets a pointer to the task ID of the application identified by mdlDesc;
获取一个指向由mdlDesc标识的应用程序的任务ID的指针。
功能说明:

输入:

输出:

示例:

事件Events

AcsOperationEvent;

  1. public event AcsOperationEventHandler AcsOperationEvent;
  2. public delegate void AcsOperationEventHandler(AddIn sender, AcsOperationEventArgs eventArgs);

功能说明:

当 ACS is created, deleted, or modified调用

输入:

AddIn sender, 插件实例 AcsOperationEventArgs eventArgs,操作参数,如下: public class AcsOperationEventArgs : EventArgs { public IAuxCoordSys* ACS;//The ACS public string Description;//The ACS description public ACSEventType EventType;//the Event public string Name; //The ACS name public int OpType;//The type of change that occurred public ACSType Type;//Type of the ACS

  1. public AcsOperationEventArgs(char* acsNameP, char* acsDescP, ACSType acsType, AcsChangeType opType, IAuxCoordSys* acs, ACSEventType eventType);
  2. }

public enum ACSEventType { None = 0, ParameterChanged = 1,// An ACS nongeometry parameter changed (e.g. description). GeometryChanged = 2,// An ACS geometry parameter changed (e.g. origin). ChangeWritten = 4,// An ACS was written to the file. NewACS = 8,// The ACS written was new. Delete = 16// the ACS was deleted from the file. }

输出:

示例:

  1. protected override int Run(string[] commandLine)
  2. {
  3. AcsOperationEvent += Addin_AcsOperationEventHandler;
  4. return 0;
  5. }
  6. private void Addin_AcsOperationEventHandler(AddIn sender, AcsOperationEventArgs eventArgs)
  7. {
  8. }

ActiveLockChangedEvent;

  1. public event ActiveLockChangedEventHandler ActiveLockChangedEvent;

功能说明:

输入:

输出:

示例:

ActiveParamChangedEvent;

  1. public event ActiveParamChangedEventHandler ActiveParamChangedEvent;
  2. public delegate void ActiveLockChangedEventHandler(AddIn sender, ActiveLockChangedEventArgs args);

功能说明:

激活锁改变事件的事件

输入:

AddIn sender, ActiveLockChangedEventArgs args 参数如下: public class ActiveLockChangedEventArgs : EventArgs { public ActiveLockChangedEventArgs(LockChangedId id);

  1. public LockChangedId Id { get; }
  2. }

public enum LockChangedId { Snap = 1, Grid = 2, Unit = 3, Angle = 5, Textnode = 6, Axis = 7, Scale = 8, GraphicGroup = 9, Level = 10, CellStretch = 11, ConstructionPlane = 13, Isometric = 14, Association = 15, Depth = 16, ConstructionPlanePerp = 17, FenceMode = 18, IsometricPlane = 19, UseAnnotationScale = 20, ACSContext = 21, ElementTemplateAssociation = 22, SharedCells = 23 }

输出:

示例:

  1. private void OnActiveLockChanged (AddIn sender, AddIn.ActiveLockChangedEventArgs e)
  2. {
  3. if (e.Id == LockChangedId.UseAnnotationScale )
  4. return;
  5. }

BeforeNewDesignFileEvent;

  1. public event BeforeNewDesignFileEventHandler BeforeNewDesignFileEvent;

功能说明:

输入:

输出:

示例:

CellLibraryChangedEvent;

  1. public event CellLibraryChangedEventHandler CellLibraryChangedEvent;

功能说明:

输入:

输出:

示例:

ChildTerminatedEvent;

  1. public event ChildTerminatedEventHandler ChildTerminatedEvent;

功能说明:

输入:

输出:

示例:

CmdWindowOpenEvent;

  1. public event CmdWindowOpenEventHandler CmdWindowOpenEvent;

功能说明:

输入:

输出:

示例:

ColorMapChangedEvent;

  1. public event ColorMapChangedEventHandler ColorMapChangedEvent;

功能说明:

输入:

输出:

示例:

CompressDesignFileEvent;

  1. public event CompressDesignFileEventHandler CompressDesignFileEvent;

功能说明:

输入:

输出:

示例:

DgnCacheUnloadingEvent;

  1. public event DgnCacheUnloadingEventHandler DgnCacheUnloadingEvent;

功能说明:

输入:

输出:

示例:

ElementChangedEvent;

  1. public event ElementChangedEventHandler ElementChangedEvent;

功能说明:

输入:

输出:

示例:

ElementUndoRedoEvent;

  1. public event ElementUndoRedoEventHandler ElementUndoRedoEvent;

功能说明:

输入:

输出:

示例:

ExitDesignFileStateEvent;

  1. public event EventHandler ExitDesignFileStateEvent;

功能说明:

输入:

输出:

示例:

FileSaveAsEvent;

  1. public event FileSaveAsEventHandler FileSaveAsEvent;

功能说明:

输入:

输出:

示例:

FileSaveEvent;

  1. public event FileSaveEventHandler FileSaveEvent;

功能说明:

输入:

输出:

示例:

LevelChangeEvent;

  1. public event LevelChangeEventHandler LevelChangeEvent;

功能说明:

输入:

输出:

示例:

LevelFilterChangedEvent;

  1. public event LevelFilterChangedEventHandler LevelFilterChangedEvent;

功能说明:

输入:

输出:

示例:

LevelMaskPostChangeEvent;

  1. public event LevelMaskPostChangeEventHandler LevelMaskPostChangeEvent;

功能说明:

输入:

输出:

示例:

MessageCenterWriteEvent;

  1. public event MessageCenterWriteEventHandler MessageCenterWriteEvent;

功能说明:

输入:

输出:

示例:

ModelChangedEvent;

  1. public event ModelChangedEventHandler ModelChangedEvent;

功能说明:

输入:

输出:

示例:

NewDesignFileEvent;

  1. public event NewDesignFileEventHandler NewDesignFileEvent;

功能说明:

输入:

输出:

示例:

ReferenceAttachedEvent;

  1. public event ReferenceAttachedEventHandler ReferenceAttachedEvent;

功能说明:

输入:

输出:

示例:

ReferenceDetachedEvent;

  1. public event ReferenceDetachedEventHandler ReferenceDetachedEvent;

功能说明:

输入:

输出:

示例:

ReferenceModifiedEvent;

  1. public event ReferenceModifiedEventHandler ReferenceModifiedEvent;

功能说明:

输入:

输出:

示例:

ReloadEvent;

  1. public event ReloadEventHandler ReloadEvent;

功能说明:

输入:

输出:

示例:

SelectedViewChangedEvent;

  1. public event SelectedViewChangedEventHandler SelectedViewChangedEvent;

功能说明:

输入:

输出:

示例:

SelectionChangedEvent;

  1. public event SelectionChangedEventHandler SelectionChangedEvent;

功能说明:

输入:

输出:

示例:

UndoRedoFinishedEvent;

  1. public event UndoRedoFinishedEventHandler UndoRedoFinishedEvent;

功能说明:

输入:

输出:

示例:

UnloadAnyAppEvent;

  1. public event UnloadAnyAppEventHandler UnloadAnyAppEvent;

功能说明:

输入:

输出:

示例:

UnloadedEvent;

  1. public event UnloadedEventHandler UnloadedEvent;

功能说明:

输入:

输出:

示例:

UnloadingEvent;

  1. public event UnloadingEventHandler UnloadingEvent;

功能说明:

输入:

输出:

示例:

ViewGroupCacheChangeEvent;

  1. public event ViewGroupCacheChangeEventHandler ViewGroupCacheChangeEvent;

功能说明:

输入:

输出:

示例:

ViewGroupChangeEvent;

  1. public event ViewGroupChangeEventHandler ViewGroupChangeEvent;

功能说明:

输入:

输出:

示例:

XAttributeChangedEvent;

  1. public event XAttributeChangedEventHandler XAttributeChangedEvent;

功能说明:

输入:

输出:

示例:

XAttributeUndoRedoEvent;

  1. public event XAttributeUndoRedoEventHandler XAttributeUndoRedoEvent;

功能说明:

输入:

输出:

示例:

代码实例

  1. public static string SystemTaskId;
  2. protected AddIn(IntPtr mdlDescriptor);
  3. public MdlApplicationType ApplicationType { get; set; }
  4. public virtual LifetimeCollection Disposables { get; }
  5. public virtual string MdlTaskId { get; }
  6. public event AcsOperationEventHandler AcsOperationEvent;
  7. public event ActiveLockChangedEventHandler ActiveLockChangedEvent;
  8. public event ActiveParamChangedEventHandler ActiveParamChangedEvent;
  9. public event BeforeNewDesignFileEventHandler BeforeNewDesignFileEvent;
  10. public event CellLibraryChangedEventHandler CellLibraryChangedEvent;
  11. public event ChildTerminatedEventHandler ChildTerminatedEvent;
  12. public event CmdWindowOpenEventHandler CmdWindowOpenEvent;
  13. public event ColorMapChangedEventHandler ColorMapChangedEvent;
  14. public event CompressDesignFileEventHandler CompressDesignFileEvent;
  15. public event DgnCacheUnloadingEventHandler DgnCacheUnloadingEvent;
  16. public event ElementChangedEventHandler ElementChangedEvent;
  17. public event ElementUndoRedoEventHandler ElementUndoRedoEvent;
  18. public event EventHandler ExitDesignFileStateEvent;
  19. public event FileSaveAsEventHandler FileSaveAsEvent;
  20. public event FileSaveEventHandler FileSaveEvent;
  21. public event LevelChangeEventHandler LevelChangeEvent;
  22. public event LevelFilterChangedEventHandler LevelFilterChangedEvent;
  23. public event LevelMaskPostChangeEventHandler LevelMaskPostChangeEvent;
  24. public event MessageCenterWriteEventHandler MessageCenterWriteEvent;
  25. public event ModelChangedEventHandler ModelChangedEvent;
  26. public event NewDesignFileEventHandler NewDesignFileEvent;
  27. public event ReferenceAttachedEventHandler ReferenceAttachedEvent;
  28. public event ReferenceDetachedEventHandler ReferenceDetachedEvent;
  29. public event ReferenceModifiedEventHandler ReferenceModifiedEvent;
  30. public event ReloadEventHandler ReloadEvent;
  31. public event SelectedViewChangedEventHandler SelectedViewChangedEvent;
  32. public event SelectionChangedEventHandler SelectionChangedEvent;
  33. public event UndoRedoFinishedEventHandler UndoRedoFinishedEvent;
  34. public event UnloadAnyAppEventHandler UnloadAnyAppEvent;
  35. public event UnloadedEventHandler UnloadedEvent;
  36. public event UnloadingEventHandler UnloadingEvent;
  37. public event ViewGroupCacheChangeEventHandler ViewGroupCacheChangeEvent;
  38. public event ViewGroupChangeEventHandler ViewGroupChangeEvent;
  39. public event XAttributeChangedEventHandler XAttributeChangedEvent;
  40. public event XAttributeUndoRedoEventHandler XAttributeUndoRedoEvent;
  41. public static void ActivateExceptionHandler();
  42. public static void DeactivateExceptionHandler();
  43. public static AddIn FindAddInByTaskId(string taskId);
  44. public static string GetMdlTaskID(AddInAttribute addInAttribute);
  45. public static bool IsAddInLoaded(string taskId);
  46. public static int Load(string[] commandTail, IntPtr mdlDesc);
  47. public static int LoadApplicationListByConfigVar(string cfgVarName, string firstArg, MdlApplicationType appType);
  48. public static int LoadAssemblyListByConfigVar(string cfgVarName, string callerID, Type attributeType, bool throwOnNotFound, params NamedArgument[] additionalArguments);
  49. public static int LoadLibraryAddIn(string pathP, string taskIdP, string pArgument);
  50. public static int LoadLibraryAddIn(string pathP, string taskIdP, string appDomainP, string pArgument);
  51. public static void LoadUnattachedCommandTable(string fileName);
  52. public static int UnloadAddIn(string taskId);
  53. public static int UnloadAddIn(AddIn addIn);
  54. public virtual IntPtr GetMdlDescriptor();
  55. public int LoadAddIn(string pathP, string taskIdP, string pArgument);
  56. public int LoadAddIn(string pathP, string taskIdP, string appDomainP, string pArgument);
  57. public ulong LookupCommandNumberFromKeyinString(string keyinString);
  58. protected virtual void OnUnloaded(UnloadedEventArgs eventArgs);
  59. protected virtual void OnUnloading(UnloadingEventArgs eventArgs);
  60. protected abstract int Run(string[] commandLine);
  61. public enum ChangeTrackKind
  62. {
  63. Delete = 1,
  64. Add = 2,
  65. Modify = 3,
  66. ModifyFence = 5,
  67. Mark = 7,
  68. ModelAdd = 9,
  69. ModelDelete = 10,
  70. AddXAttribute = 11,
  71. DeleteXAttribute = 12,
  72. ModifyXAttribute = 13,
  73. ReplaceXAttribute = 14
  74. }
  75. public enum ChangeTrackSource
  76. {
  77. UndoRedo = 1,
  78. HistoryRestore = 2,
  79. HistoryMerge = 3
  80. }
  81. public enum UnloadReasons
  82. {
  83. AppDomainUnloading = -6,
  84. EnteringRestrictedRightsMode = -5,
  85. UnloadUserInterfaceServers = -4,
  86. LibraryUnload = -3,
  87. Shutdown = -2,
  88. Fatal = -1,
  89. Command = 1,
  90. ExitBySelf = 2,
  91. ExitByOtherApp = 3,
  92. Exception = 4
  93. }
  94. public struct ChangeTrackInfo
  95. {
  96. public short FunctionName;
  97. public int GroupID;
  98. public int ProcessNumber;
  99. }
  100. public class AcsOperationEventArgs : EventArgs
  101. {
  102. public IAuxCoordSys* ACS;
  103. public string Description;
  104. public ACSEventType EventType;
  105. public string Name;
  106. public int OpType;
  107. public ACSType Type;
  108. public AcsOperationEventArgs(char* acsNameP, char* acsDescP, ACSType acsType, AcsChangeType opType, IAuxCoordSys* acs, ACSEventType eventType);
  109. }
  110. public class ActiveLockChangedEventArgs : EventArgs
  111. {
  112. public ActiveLockChangedEventArgs(LockChangedId id);
  113. public LockChangedId Id { get; }
  114. }
  115. public class ActiveParamChangedEventArgs : EventArgs
  116. {
  117. public ActiveParamChangedEventArgs(ActiveParamId id);
  118. public ActiveParamId Id { get; }
  119. }
  120. public class BeforeNewDesignFileEventArgs : EventArgs
  121. {
  122. public string Name;
  123. public BeforeNewDesignFileEventArgs(char* filenameP);
  124. }
  125. public class CellLibraryChangedEventArgs : EventArgs
  126. {
  127. public CellLibraryChangedEventArgs(string path, ChangeType type);
  128. public string LibraryPath { get; set; }
  129. public ChangeType Type { get; set; }
  130. public enum ChangeType
  131. {
  132. Errpr = -1,
  133. PreAttach = 0,
  134. PostAttach = 1,
  135. PreDetach = 2,
  136. PostDetach = 3,
  137. PreCreate = 4,
  138. PostCreate = 5
  139. }
  140. }
  141. public class ChildTerminatedEventArgs : EventArgs
  142. {
  143. public string MdlTaskId;
  144. public UnloadReasons UnloadKind;
  145. public int UnloadStatus;
  146. }
  147. public class CmdWindowOpenEventArgs : EventArgs
  148. {
  149. public int CmdWindow;
  150. public CmdWindowOpenEventArgs(void* cmdWindow);
  151. }
  152. public class ColorMapChangedEventArgs : EventArgs
  153. {
  154. public ColorMapChangedEventArgs(DgnModelRef* modelRefIn);
  155. public DgnPlatformNET.DgnModelRef DgnModelRef { get; }
  156. }
  157. public class CompressDesignFileEventArgs : EventArgs
  158. {
  159. public Response ResponseCode;
  160. public string ReturnErrorMsg;
  161. public When WhenCode;
  162. public enum Response
  163. {
  164. CompressionProceed = 0,
  165. CompressionAbort = 1
  166. }
  167. public enum When
  168. {
  169. BeforeDesignFileCompress = 1,
  170. AfterDesignFileCompress = 2
  171. }
  172. }
  173. public class DgnCacheUnloadingEventArgs : EventArgs
  174. {
  175. public IntPtr DgnCachePtr;
  176. }
  177. public class ElementChangedEventArgs : EventArgs
  178. {
  179. public ChangeTrackKind Change;
  180. public ChangeTrackInfo Info;
  181. public IntPtr OldElementRef;
  182. public IntPtr OldModelRef;
  183. public ElementChangedEventArgs(MSElementDescr* newElemDescrP, MSElementDescr* oldElemDescrP, IntPtr oldElemRef, IntPtr oldModelRef, ChangeTrackKind changeKind, int processNumber, short functionName, int groupID, bool* cannotBeUndoneFlagP);
  184. public IntPtr NewElemDescr { get; }
  185. public Element NewElement { get; }
  186. public IntPtr OldElemDescr { get; }
  187. public bool Undoable { get; set; }
  188. }
  189. public class ElementUndoRedoEventArgs : EventArgs
  190. {
  191. public ChangeTrackKind Change;
  192. public bool IsUndo;
  193. public IntPtr OldElementRef;
  194. public IntPtr OldModelRef;
  195. public ChangeTrackSource Source;
  196. public ElementUndoRedoEventArgs(MSElementDescr* newElemDescrP, MSElementDescr* oldElemDescrP, IntPtr oldElemRef, IntPtr oldModelRef, ChangeTrackKind changeKind, bool isUndo, ChangeTrackInfo* info, ChangeTrackSource changeSource);
  197. public IntPtr NewElemDescr { get; }
  198. public Element NewElement { get; }
  199. public IntPtr NewElementRef { get; }
  200. public IntPtr OldElemDescr { get; }
  201. }
  202. public class FileSaveAsEventArgs : EventArgs
  203. {
  204. public string DestinationFileName;
  205. public When WhenCode;
  206. public enum When
  207. {
  208. BeforeSaveAsFileCreated = 0,
  209. AfterSaveAsFileCreated = 1
  210. }
  211. }
  212. public class FileSaveEventArgs : EventArgs
  213. {
  214. public Changes ChangesCode;
  215. public string MasterFileName;
  216. public Reason ReasonCode;
  217. public double TimeStamp;
  218. public When WhenCode;
  219. public enum Changes
  220. {
  221. Abandon = 0,
  222. Save = 1,
  223. FullSave = 2
  224. }
  225. public enum Reason
  226. {
  227. UserInitiated = 1,
  228. ApplInitiated = 2,
  229. ReffileSave = 3,
  230. FileClose = 4,
  231. FileCompress = 5,
  232. FileSaveAs = 6,
  233. AutoTime = 7,
  234. PreCommit = 8,
  235. SaveSettings = 9,
  236. Backup = 10,
  237. Encrypt = 11,
  238. Precompress = 12
  239. }
  240. public enum When
  241. {
  242. BeforeProcessing = 0,
  243. AfterProcessing = 1
  244. }
  245. }
  246. public class LevelChangeEventArgs : EventArgs
  247. {
  248. public LevelChangeEventArgs(LevelHandle levelIn, ChangeType changeIn);
  249. public ChangeType Change { get; }
  250. public LevelHandle Level { get; }
  251. public enum ChangeType
  252. {
  253. TableRewrite = 1,
  254. Create = 2,
  255. Delete = 3,
  256. ChangeName = 4,
  257. ChangeCode = 5,
  258. ChangeParent = 6,
  259. ChangeDisplay = 7,
  260. ChangeAttribute = 8,
  261. ChangeActive = 9,
  262. LibraryAttach = 10,
  263. LibraryDetach = 11,
  264. ChangeUsage = 12,
  265. ChangeElementCount = 13,
  266. TableUndo = 14,
  267. TableRedo = 15,
  268. TableImport = 16,
  269. PreChangeActive = 17,
  270. PreDelete = 18
  271. }
  272. }
  273. public class LevelFilterChangedEventArgs : EventArgs
  274. {
  275. public LevelFilterChangedEventArgs(string name, uint filterId, FilterChangeType changeType);
  276. public FilterChangeType ChangeType { get; }
  277. public uint FilterId { get; }
  278. public string FilterName { get; }
  279. public enum FilterChangeType
  280. {
  281. Change = 1,
  282. Active = 2,
  283. Create = 3,
  284. Delete = 4,
  285. ChangeName = 5,
  286. ChangeDescription = 6,
  287. ChangeType = 7,
  288. ChangePersistent = 8,
  289. ChangeFlag = 9,
  290. ChangeParent = 10,
  291. ChangeExpression = 11,
  292. TableImport = 12,
  293. TableUndo = 13,
  294. TableRedo = 14
  295. }
  296. }
  297. public class LevelMaskPostChangeEventArgs : EventArgs
  298. {
  299. public LevelMaskPostChangeEventArgs(DgnModelRef* modelRefIn, int viewNumber);
  300. public DgnPlatformNET.DgnModelRef DgnModelRef { get; }
  301. public int ViewNumber { get; }
  302. }
  303. public class MessageCenterWriteEventArgs : EventArgs
  304. {
  305. public string Detail;
  306. public int DetailMessageAttributes;
  307. public string Message;
  308. public int MessageType;
  309. public MessageCenterWriteEventArgs(int messageType, char* pMessage, char* pDetail, int detailMessageAttributes);
  310. }
  311. public class ModelChangedEventArgs : EventArgs
  312. {
  313. public ModelChangedEventArgs(DgnModelRef* modelRefIn, ChangeType changeIn);
  314. public ChangeType Change { get; }
  315. public DgnPlatformNET.DgnModelRef DgnModelRef { get; }
  316. public void ClearDgnModelRef();
  317. public enum ChangeType
  318. {
  319. Create = 1,
  320. Delete = 2,
  321. Properties = 3,
  322. Settings = 4,
  323. Active = 5,
  324. BeforeDelete = 6,
  325. UnCreate = 7,
  326. UnDelete = 8,
  327. BeforeUnCreate = 9,
  328. Name = 10,
  329. BeforeActive = 11,
  330. BeforeName = 12,
  331. BeforeSettings = 13,
  332. BeforeProperties = 14,
  333. BeforeCreate = 15,
  334. BeforeUnDelete = 16,
  335. PropagateAnnotationScale = 17,
  336. BeforeCopy = 18,
  337. Copied = 19,
  338. BeforeUndoProperties = 20,
  339. UndoProperties = 21
  340. }
  341. }
  342. public class NewDesignFileEventArgs : EventArgs
  343. {
  344. public string Name;
  345. public When WhenCode;
  346. public NewDesignFileEventArgs(char* filenameP, int preOrPost);
  347. public enum When
  348. {
  349. BeforeDesignFileClose = 0,
  350. AfterDesignFileOpen = 1
  351. }
  352. }
  353. public class ReferenceAttachedEventArgs : EventArgs
  354. {
  355. public ReferenceAttachedEventArgs(DgnModelRef* modelRefIn, AttachCause attachCauseIn);
  356. public AttachCause Cause { get; }
  357. public DgnPlatformNET.DgnAttachment DgnAttachment { get; }
  358. public enum AttachCause
  359. {
  360. New = 0,
  361. ReAttached = 1,
  362. UndoneDetach = 2,
  363. RedoneAttach = 3,
  364. Reloaded = 4,
  365. ReAttachUndoRedo = 5,
  366. ReAttachChildrenReloaded = 6
  367. }
  368. }
  369. public class ReferenceDetachedEventArgs : EventArgs
  370. {
  371. public ReferenceDetachedEventArgs(DgnModelRef* modelRefIn, string fileNameIn, DetachCause detachCauseIn);
  372. public DetachCause Cause { get; }
  373. public DgnPlatformNET.DgnAttachment DgnAttachment { get; }
  374. public string FileName { get; }
  375. public enum DetachCause
  376. {
  377. Detached = 0,
  378. UndoAttach = 1,
  379. RedoneDetach = 2,
  380. ReAttached = 3,
  381. ModelDeleted = 4,
  382. Reloaded = 5
  383. }
  384. }
  385. public class ReferenceModifiedEventArgs : EventArgs
  386. {
  387. public ReferenceModifiedEventArgs(DgnPlatform.DgnAttachment* oldReferenceFileIn, DgnPlatform.DgnAttachment* newReferenceFileIn, DgnModelRef* modelRefIn, bool changesWrittenIn);
  388. public bool ChangesWritten { get; }
  389. public DgnPlatformNET.DgnAttachment DgnAttachment { get; }
  390. public DgnPlatform.DgnAttachment* NewReferenceFile { get; }
  391. public DgnPlatform.DgnAttachment* OldReferenceFile { get; }
  392. }
  393. public class ReloadEventArgs : EventArgs
  394. {
  395. public string[] CommandLine;
  396. public ReloadEventArgs(int argc, char** argv);
  397. }
  398. public class SelectedViewChangedEventArgs : EventArgs
  399. {
  400. public bool FromButtonEvent;
  401. public int NewViewIndex;
  402. public int OldViewIndex;
  403. public SelectedViewChangedEventArgs(int oldViewIndex, int newViewIndex, bool fromButtonEvent);
  404. }
  405. public class SelectionChangedEventArgs : EventArgs
  406. {
  407. public ActionKind Action;
  408. public uint FilePosition;
  409. public Response ResponseCode;
  410. public SelectionChangedEventArgs(ActionKind actionKind, uint filePosition, DgnModelRef* modelRefP);
  411. public DgnPlatformNET.DgnModelRef DgnModelRef { get; }
  412. public enum ActionKind
  413. {
  414. Nothing = 0,
  415. Stretch = 1,
  416. Window = 2,
  417. Drag = 3,
  418. DragNew = 4,
  419. SetEmpty = 6,
  420. SetChanged = 8,
  421. DoubleClickHandle = 10,
  422. DoubleClickElement = 11
  423. }
  424. public enum Response
  425. {
  426. SelectProceed = 0,
  427. SelectAbort = 1
  428. }
  429. }
  430. public class UndoRedoFinishedEventArgs : EventArgs
  431. {
  432. public bool IsUndo;
  433. public UndoRedoFinishedEventArgs(bool isUndo);
  434. }
  435. public class UnloadAnyAppEventArgs : EventArgs
  436. {
  437. public string MdlTaskId;
  438. public UnloadReasons UnloadKind;
  439. public UnloadAnyAppEventArgs(UnloadReasons reasonCode, string mdlTaskId);
  440. }
  441. public class UnloadedEventArgs : EventArgs
  442. {
  443. public UnloadReasons UnloadKind;
  444. public UnloadedEventArgs(UnloadReasons reasonCode);
  445. }
  446. public class UnloadingEventArgs : UnloadedEventArgs
  447. {
  448. public Response ResponseCode;
  449. public UnloadingEventArgs(UnloadReasons reasonCode);
  450. public enum Response
  451. {
  452. UnloadProceed = 0,
  453. UnloadAbort = 1
  454. }
  455. }
  456. public class ViewGroupCacheChangeEventArgs : EventArgs
  457. {
  458. public int ChangeType;
  459. public string Description;
  460. public string Name;
  461. public ViewGroupCacheChangeEventArgs(char* nameP, char* descriptionP, ViewGroupChangeType type);
  462. }
  463. public class ViewGroupChangeEventArgs : EventArgs
  464. {
  465. public ViewGroup CurrentViewGroup;
  466. public ChangeType m_change;
  467. public ViewGroup NewViewGroup;
  468. public ViewGroupChangeEventArgs(ViewGroup* currentViewGroup, ViewGroup* newViewGroup, VIEWGROUP_ChangeType changeType);
  469. public ChangeType Change { get; }
  470. public enum ChangeType
  471. {
  472. BeforeFileClose = 1,
  473. BeforeApply = 2,
  474. AfterApply = 3,
  475. BeforeSaveAs = 4
  476. }
  477. }
  478. public class XAttributeChangedEventArgs : EventArgs
  479. {
  480. public ChangeTrackKind Change;
  481. public short FunctionName;
  482. public int GroupID;
  483. public int ProcessNumber;
  484. public XAttributeChangedEventArgs(XAttributeHandle* xattr, ChangeTrackKind changeKind, int processNumber, short functionName, int groupID, bool* cannotBeUndoneFlagP);
  485. public bool Undoable { get; set; }
  486. }
  487. public class XAttributeUndoRedoEventArgs : EventArgs
  488. {
  489. public ChangeTrackKind Change;
  490. public bool IsUndo;
  491. public ChangeTrackSource Source;
  492. public XAttributeUndoRedoEventArgs(XAttributeHandle* xAttr, ChangeTrackKind changeKind, bool isUndo, ChangeTrackInfo* info, ChangeTrackSource changeSource);
  493. }
  494. public delegate void AcsOperationEventHandler(AddIn sender, AcsOperationEventArgs eventArgs);
  495. public delegate void ActiveLockChangedEventHandler(AddIn sender, ActiveLockChangedEventArgs args);
  496. public delegate void ActiveParamChangedEventHandler(AddIn sender, ActiveParamChangedEventArgs args);
  497. public delegate void BeforeNewDesignFileEventHandler(AddIn sender, BeforeNewDesignFileEventArgs eventArgs);
  498. public delegate void CellLibraryChangedEventHandler(AddIn sender, CellLibraryChangedEventArgs e);
  499. public delegate void ChildTerminatedEventHandler(AddIn sender, ChildTerminatedEventArgs eventArgs);
  500. public delegate void CmdWindowOpenEventHandler(AddIn sender, CmdWindowOpenEventArgs eventArgs);
  501. public delegate void ColorMapChangedEventHandler(AddIn senderIn, ColorMapChangedEventArgs eventArgsIn);
  502. public delegate void CompressDesignFileEventHandler(AddIn sender, CompressDesignFileEventArgs eventArgs);
  503. public delegate void DgnCacheUnloadingEventHandler(AddIn sender, DgnCacheUnloadingEventArgs eventArgs);
  504. public delegate void ElementChangedEventHandler(AddIn sender, ElementChangedEventArgs eventArgs);
  505. public delegate void ElementUndoRedoEventHandler(AddIn sender, ElementUndoRedoEventArgs eventArgs);
  506. public delegate void EventHandler(AddIn sender, EventArgs eventArgs);
  507. public delegate void FileSaveAsEventHandler(AddIn sender, FileSaveAsEventArgs eventArgs);
  508. public delegate void FileSaveEventHandler(AddIn sender, FileSaveEventArgs eventArgs);
  509. public delegate void LevelChangeEventHandler(AddIn senderIn, LevelChangeEventArgs eventArgsIn);
  510. public delegate void LevelFilterChangedEventHandler(AddIn senderIn, LevelFilterChangedEventArgs eventArgsIn);
  511. public delegate void LevelMaskPostChangeEventHandler(AddIn senderIn, LevelMaskPostChangeEventArgs eventArgsIn);
  512. public delegate void MessageCenterWriteEventHandler(AddIn sender, MessageCenterWriteEventArgs eventArgs);
  513. public delegate void ModelChangedEventHandler(AddIn senderIn, ModelChangedEventArgs eventArgsIn);
  514. public delegate void NewDesignFileEventHandler(AddIn sender, NewDesignFileEventArgs eventArgs);
  515. public delegate void ReferenceAttachedEventHandler(AddIn senderIn, ReferenceAttachedEventArgs eventArgsIn);
  516. public delegate void ReferenceDetachedEventHandler(AddIn senderIn, ReferenceDetachedEventArgs eventArgsIn);
  517. public delegate void ReferenceModifiedEventHandler(AddIn senderIn, ReferenceModifiedEventArgs eventArgsIn);
  518. public delegate void ReloadEventHandler(AddIn sender, ReloadEventArgs eventArgs);
  519. public delegate void SelectedViewChangedEventHandler(AddIn sender, SelectedViewChangedEventArgs eventArgs);
  520. public delegate void SelectionChangedEventHandler(AddIn sender, SelectionChangedEventArgs eventArgs);
  521. public delegate void UndoRedoFinishedEventHandler(AddIn sender, UndoRedoFinishedEventArgs eventArgs);
  522. public delegate void UnloadAnyAppEventHandler(AddIn sender, UnloadAnyAppEventArgs eventArgs);
  523. public delegate void UnloadedEventHandler(AddIn sender, UnloadedEventArgs eventArgs);
  524. public delegate void UnloadingEventHandler(AddIn sender, UnloadingEventArgs eventArgs);
  525. public delegate void ViewGroupCacheChangeEventHandler(AddIn sender, ViewGroupCacheChangeEventArgs eventArgs);
  526. public delegate void ViewGroupChangeEventHandler(AddIn sender, ViewGroupChangeEventArgs eventArgs);
  527. public delegate void XAttributeChangedEventHandler(AddIn sender, XAttributeChangedEventArgs eventArgs);
  528. public delegate void XAttributeUndoRedoEventHandler(AddIn sender, XAttributeUndoRedoEventArgs eventArgs);