예제 #1
0
        public static DeferredError Create(MailboxSession session, StoreObjectId folderId, string providerName, long ruleId, RuleAction.Type actionType, int actionNumber, DeferredError.RuleError ruleError)
        {
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullArgument(folderId, "folderId");
            Util.ThrowOnNullArgument(providerName, "providerName");
            EnumValidator.ThrowIfInvalid <RuleAction.Type>(actionType, "actionType");
            EnumValidator.ThrowIfInvalid <DeferredError.RuleError>(ruleError, "ruleError");
            if (!IdConverter.IsFolderId(folderId))
            {
                throw new ArgumentException(ServerStrings.InvalidFolderId(folderId.ToBase64String()));
            }
            DeferredError deferredError = new DeferredError();

            deferredError.message = MessageItem.Create(session, session.GetDefaultFolderId(DefaultFolderType.DeferredActionFolder));
            deferredError.message[InternalSchema.ItemClass]         = "IPC.Microsoft Exchange 4.0.Deferred Error";
            deferredError.message[InternalSchema.RuleFolderEntryId] = folderId.ProviderLevelItemId;
            deferredError.message[InternalSchema.RuleId]            = ruleId;
            deferredError.message[InternalSchema.RuleActionType]    = (int)actionType;
            deferredError.message[InternalSchema.RuleActionNumber]  = actionNumber;
            deferredError.message[InternalSchema.RuleError]         = ruleError;
            deferredError.message[InternalSchema.RuleProvider]      = providerName;
            return(deferredError);
        }
예제 #2
0
 public static DeferredError CreateDAE(MailboxSession session, StoreObjectId ruleFolderId, string providerName, long ruleId, RuleAction.Type actionType, int actionNumber, DeferredError.RuleError ruleError)
 {
     return(DeferredError.Create(session, ruleFolderId, providerName, ruleId, actionType, actionNumber, ruleError));
 }