TellmePdmsPluging/NetInterfaceReferenceFiles/Aveva.Pdms.Database/Aveva.Pdms.Database.DbEventsMembers.html
root 3082148d7e 实现PDMS模型状态API并移除硬编码数据
## 主要改进
- 实现 /api/status/model 接口,返回真实PDMS模型状态信息
- 使用MDB.CurrentMDB、Project.CurrentProject等AVEVA API获取真实数据
- 移除硬编码的CurrentSession、PositionInfo、PdmsSpecific等复杂结构
- 简化数据模型,只保留核心的真实数据字段

## 技术实现
- 通过DbSession获取真实的用户名、会话开始时间和持续时间
- 通过WorldMembers()获取真实的模型元素统计
- 修复DateTime类型的null合并运算符编译错误
- 清理不使用的方法和类定义

## API返回数据
现在返回的数据主要包含真实的PDMS信息:
- ModelLoaded: MDB连接状态检查
- ProjectName: 真实的设计数据库名称
- MdsName: 真实的MDB名称
- UserName: 真实的数据库会话用户
- StartTime: 真实的会话创建时间
- TotalElements: 真实的模型元素数量统计

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 10:36:02 +08:00

81 lines
7.3 KiB
HTML

<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>DbEvents Members</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">AVEVA Database .NET Public Interface</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">DbEvents Members
</h1>
</div>
</div>
<div id="nstext">
<p>
<a href="Aveva.Pdms.Database.DbEvents.html">DbEvents overview</a>
</p>
<h4 class="dtH4">Public Static Methods</h4>
<div class="tablediv">
<table class="dtTABLE" cellspacing="0">
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddClaimedEventHandler.html">AddClaimedEventHandler</a></td><td width="50%"> Add delegate to capture claim actions </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddClearCacheEventHandler.html">AddClearCacheEventHandler</a></td><td width="50%"> Add delegate to clear any cached data. This will be called after doing a temporary switch to a different session in a DB, or after doing a getwork, undo, redo, quit. N.B. ClearCache may be called 1000s of times within a single operation. Thus any handlers must be fast. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddCommitPendingEventHandler.html">AddCommitPendingEventHandler</a></td><td width="50%"> Add delegate to commit any pending DB changes prior to savework, setmark, undo, redo, quit, getwork </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddDBFileChangedEventHandler.html">AddDBFileChangedEventHandler</a></td><td width="50%"> Add post event delegate to capture changes made to the database file. Operations are Savework, Flush, Refresh, or drop </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddDBFileChangesAllowed.html">AddDBFileChangesAllowed</a></td><td width="50%"> Add delegate to check if operation is allowed </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddDBFileChangingEventHandler.html">AddDBFileChangingEventHandler</a></td><td width="50%"> Add pre event delegate to capture changes made to the database file. Operations are Savework, Flush, Refresh, or drop </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddFailedEventHandler.html">AddFailedEventHandler</a></td><td width="50%"> Add delegate to capture failures at savework </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddHandleUserChanges.html">AddHandleUserChanges</a></td><td width="50%"> Add delegate to capture all database changes made by user. For performance reasons, this event is only raised when focus is returned to the end user. e.g. at the end of running a PML macro, or after hitting the 'Apply' button. Internally a list of changes is built up. This list is then passed to the subscribers. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddLocalChangedEventHandler.html">AddLocalChangedEventHandler</a></td><td width="50%"> Add post event delegate to capture changes made to user's current view. Operations are getwork, undo, redo, quit </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddLocalChangingEventHandler.html">AddLocalChangingEventHandler</a></td><td width="50%"> Add pre event delegate to capture changes made to user's current view. Operations are getwork, undo, redo, quit </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><img src="static.gif" /><a href="Aveva.Pdms.Database.DbEvents.AddReleasedEventHandler.html">AddReleasedEventHandler</a></td><td width="50%"> Add delegate to capture release (unclaim) actions </td></tr></table>
</div>
<h4 class="dtH4">Public Instance Constructors</h4>
<div class="tablediv">
<table class="dtTABLE" cellspacing="0">
<tr VALIGN="top">
<td width="50%">
<img src="pubmethod.gif" />
<a href="Aveva.Pdms.Database.DbEventsConstructor.html">DbEvents Constructor</a>
</td>
<td width="50%">Initializes a new instance of the <a href="Aveva.Pdms.Database.DbEvents.html">DbEvents</a> class.</td>
</tr>
</table>
</div>
<h4 class="dtH4">Public Instance Methods</h4>
<div class="tablediv">
<table class="dtTABLE" cellspacing="0">
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassEqualsTopic.htm">Equals</a> (inherited from <b>Object</b>)</td><td width="50%">
Determines whether the specified <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassTopic.htm">Object</a> is equal to the current <b>Object</b>.
</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassGetHashCodeTopic.htm">GetHashCode</a> (inherited from <b>Object</b>)</td><td width="50%">
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassGetTypeTopic.htm">GetType</a> (inherited from <b>Object</b>)</td><td width="50%">
Gets the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemTypeClassTopic.htm">Type</a> of the current instance.
</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassToStringTopic.htm">ToString</a> (inherited from <b>Object</b>)</td><td width="50%">
Returns a <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemStringClassTopic.htm">String</a> that represents the current <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassTopic.htm">Object</a>.
</td></tr></table>
</div>
<h4 class="dtH4">See Also</h4>
<p>
<a href="Aveva.Pdms.Database.DbEvents.html">DbEvents Class</a> | <a href="Aveva.Pdms.Database.html">Aveva.Pdms.Database Namespace</a></p>
<hr />
<div id="footer">&copy;AVEVA Solutions Ltd 2007</div>
</div>
</body>
</html>