Exemplo n.º 1
0
        // Token: 0x0600057F RID: 1407 RVA: 0x0002A3C8 File Offset: 0x000285C8
        public BaseFolderType UpdateFolder(FolderChangeType folderChange)
        {
            UpdateFolderType updateFolder = new UpdateFolderType();

            updateFolder.FolderChanges = new FolderChangeType[]
            {
                folderChange
            };
            List <BaseFolderType> updatedFolders = new List <BaseFolderType>(1);

            this.CallService(() => this.ServiceBinding.UpdateFolder(updateFolder), delegate(ResponseMessageType responseMessage, int messageIndex)
            {
                if (responseMessage.ResponseClass == ResponseClassType.Error)
                {
                    throw new ElcEwsException(ElcEwsErrorType.FailedToUpdateFolder, responseMessage.ResponseCode.ToString() + " : " + responseMessage.MessageText);
                }
                FolderInfoResponseMessageType folderInfoResponseMessageType = (FolderInfoResponseMessageType)responseMessage;
                updatedFolders.AddRange(folderInfoResponseMessageType.Folders);
                return(true);
            }, (Exception exception) => ElcEwsClient.WrapElcEwsException(ElcEwsErrorType.FailedToUpdateFolder, exception));
            if (updatedFolders.Count <= 0)
            {
                return(null);
            }
            return(updatedFolders[0]);
        }
Exemplo n.º 2
0
        // Token: 0x0600053B RID: 1339 RVA: 0x000279E4 File Offset: 0x00025BE4
        public void UpdatePropertiesOnFolderInArchive(FolderTuple sourceInPrimary, FolderTuple targetInArchive)
        {
            FolderTupleRemoteArchive folderTupleRemoteArchive = targetInArchive as FolderTupleRemoteArchive;

            if (folderTupleRemoteArchive == null)
            {
                throw new ArgumentException("Archive folder tuple must be a FolderTupleRemoteArchive.", "targetInArchive");
            }
            List <FolderChangeDescriptionType> list = new List <FolderChangeDescriptionType>();

            for (FolderHelper.DataColumnIndex dataColumnIndex = FolderHelper.DataColumnIndex.startOfTagPropsIndex; dataColumnIndex <= FolderHelper.DataColumnIndex.containerClassIndex; dataColumnIndex++)
            {
                PropertyDefinition      key = FolderHelper.DataColumns[(int)dataColumnIndex];
                PathToExtendedFieldType pathToExtendedFieldType = this.EwsStorePropertyMapping[key];
                object obj  = sourceInPrimary.FolderProps[key];
                object obj2 = folderTupleRemoteArchive.FolderProps[key];
                if (obj != null && !(obj is PropertyError))
                {
                    string text = ElcEwsClientHelper.ConvertRetentionPropertyForService(obj, pathToExtendedFieldType.PropertyType);
                    string b    = ElcEwsClientHelper.ConvertRetentionPropertyForService(obj2, pathToExtendedFieldType.PropertyType);
                    if (text != b)
                    {
                        SetFolderFieldType   setFolderFieldType   = new SetFolderFieldType();
                        FolderType           folderType           = new FolderType();
                        ExtendedPropertyType extendedPropertyType = new ExtendedPropertyType
                        {
                            ExtendedFieldURI = pathToExtendedFieldType,
                            Item             = text
                        };
                        folderType.ExtendedProperty = new ExtendedPropertyType[]
                        {
                            extendedPropertyType
                        };
                        setFolderFieldType.Item  = pathToExtendedFieldType;
                        setFolderFieldType.Item1 = folderType;
                        list.Add(setFolderFieldType);
                    }
                }
                else if (obj2 != null)
                {
                    list.Add(new DeleteFolderFieldType
                    {
                        Item = pathToExtendedFieldType
                    });
                }
            }
            if (list.Count > 0)
            {
                RemoteArchiveProcessorBase.Tracer.TraceDebug <RemoteArchiveProcessorBase, int, string>((long)this.GetHashCode(), "{0}: {1} properties to be updated for folder {2}.", this, list.Count, folderTupleRemoteArchive.DisplayName);
                FolderChangeType folderChangeType = new FolderChangeType();
                folderChangeType.Item    = folderTupleRemoteArchive.EwsFolderId;
                folderChangeType.Updates = list.ToArray();
                try
                {
                    this.ArchiveEwsClient.UpdateFolder(folderChangeType);
                }
                catch (ElcEwsException arg)
                {
                    RemoteArchiveProcessorBase.Tracer.TraceError <MailboxSession, string, ElcEwsException>((long)this.GetHashCode(), "Update folder {1} in archive for {0} failed, Exception: {2}", this.primaryMailboxSession, folderTupleRemoteArchive.DisplayName, arg);
                    throw;
                }
            }
        }
Exemplo n.º 3
0
 private void Notify(FolderChangeType changeType, string path, string newPath = null, string oldPath = null)
 {
     _handler(SharedWatcher.PathWatcher, new FolderChangedEventArgs(PathPattern, path, changeType, newPath, oldPath));
     Logger?.Log(_logLevel, $"{changeType} folder: {path} (matching {UniquePath})");
 }
Exemplo n.º 4
0
 public FolderChangedEventArgs(PathPattern watchedPathPattern, string path, FolderChangeType changeType, string newPath = null, string oldPath = null)
     : base(watchedPathPattern, path, newPath, oldPath)
 {
     ChangeType = changeType;
 }