C# 救赎包装类不触发事件
我使用 Redemption 为 Outlook 外接程序编写了以下包装器类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace PSTAttachRemove_Redemption
{
class PSTWatch
{
private Redemption.RDOPstStore pst;
public PSTWatch(Redemption.RDOPstStore rPST)
{
pst = rPST;
pst.OnMessageMoved += new Redemption.IRDOStoreEvents_OnMessageMovedEventHandler(pst_OnMessageMoved);
}
void pst_OnMessageMoved(string EntryID)
{
Debug.Print(EntryID);
}
}
}
在我的主外接程序代码中,我使用以下代码调用此包装器:
void FileStorePopulation(Redemption.RDOStore store)
{
switch (store.StoreKind)
{
case TxStoreKind.skPstAnsi:
case TxStoreKind.skPstUnicode:
PSTWatch p = new PSTWatch(store as RDOPstStore);
watchedPSTs.Add(store.EntryID, p);
break;
}
}
其中 watchedPSTs 是一个全局变量。
我可以看到已填充watchedPST,但将消息移至 PST 时这些项目永远不会触发。有想法吗?
谢谢
I've written the following wrapper class for an Outlook Add-in using Redemption:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace PSTAttachRemove_Redemption
{
class PSTWatch
{
private Redemption.RDOPstStore pst;
public PSTWatch(Redemption.RDOPstStore rPST)
{
pst = rPST;
pst.OnMessageMoved += new Redemption.IRDOStoreEvents_OnMessageMovedEventHandler(pst_OnMessageMoved);
}
void pst_OnMessageMoved(string EntryID)
{
Debug.Print(EntryID);
}
}
}
In my main add-in code, I am calling this wrapper using this code:
void FileStorePopulation(Redemption.RDOStore store)
{
switch (store.StoreKind)
{
case TxStoreKind.skPstAnsi:
case TxStoreKind.skPstUnicode:
PSTWatch p = new PSTWatch(store as RDOPstStore);
watchedPSTs.Add(store.EntryID, p);
break;
}
}
where watchedPSTs is a global variable.
I can see watchedPSTs being populated, but the items never fire when moving a message into a PST. Ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何初始化 RDOSession?您是否从 OOM 调用 Logon 或将 RDOSession.MAPIOBJECT 设置为 Namespace.MAPIOBJECT?
watchPSTs 列表是在全局(类)级别声明的吗?
你使用多线程吗?
How do you initialize RDOSession? Do you call Logon or set RDOSession.MAPIOBJECT to Namespace.MAPIOBJECT from OOM?
is watchedPSTs list declared on the global (class) level?
Do you use multiple threads?