예제 #1
0
        protected virtual void ExecuteActionImpl(IResourceList selectedResources)
        {
            Tracer._Trace("Execute action: SyncMail");
            PairIDs selectedFolderIDs = PairIDs.Get(_selectedFolder);

            if (!OutlookSession.FolderExists(selectedFolderIDs))
            {
                return;
            }
            foreach (IResource resMail in selectedResources.ValidResources)
            {
                PairIDs messageIDs = PairIDs.Get(resMail);
                if (messageIDs == null)
                {
                    continue;
                }

                IEMessage message =
                    OutlookSession.OpenMessage(messageIDs.EntryId, messageIDs.StoreId);
                if (message == null)
                {
                    continue;
                }

                if (selectedFolderIDs.StoreId.Equals(messageIDs.StoreId))
                {
                    DoMoveImpl(message, messageIDs, selectedFolderIDs);
                }
                else
                {
                    DoMoveBetweenStorages(resMail, message, messageIDs, selectedFolderIDs);
                }
            }
        }