开发者

C# Redemption wrapper class not firing events

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 w开发者_高级运维rapper 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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜