Exemplo n.º 1
0
        private void DoMoveImpl(IEMessage message, PairIDs messageIDs, PairIDs selectedFolderIDs)
        {
            string parentID = string.Empty;

            using ( message )
            {
                parentID = message.GetBinProp(MAPIConst.PR_PARENT_ENTRYID);
            }
            IEFolder parentFolder =
                OutlookSession.OpenFolder(parentID, messageIDs.StoreId);

            if (parentFolder == null)
            {
                return;
            }

            using ( parentFolder )
            {
                IEFolder folder =
                    OutlookSession.OpenFolder(selectedFolderIDs.EntryId, selectedFolderIDs.StoreId);
                if (folder == null)
                {
                    return;
                }
                using ( folder )
                {
                    if (_copy)
                    {
                        parentFolder.CopyMessage(messageIDs.EntryId, folder);
                    }
                    else
                    {
                        parentFolder.MoveMessage(messageIDs.EntryId, folder);
                    }
                }
            }
        }