Esempio n. 1
0
 private void UpdateRuleAction(StoreObjectId replytemplateMessageId)
 {
     using (IModifyTable ruleTable = base.Context.CurrentFolder.GetRuleTable(null))
     {
         RuleAction       ruleAction = base.Context.CurrentRule.Actions[base.ActionIndex];
         RuleAction.Reply reply      = (RuleAction.Reply)ruleAction;
         RuleAction[]     value      = new RuleAction[]
         {
             new RuleAction.ReplyAction(reply.UserFlags, RuleActionConverter.MapiReplyFlagsToReplyFlags(reply.Flags), replytemplateMessageId, this.replyTemplateGuid)
         };
         PropValue[] propValues = new PropValue[]
         {
             new PropValue(InternalSchema.RuleId, base.Context.CurrentRule.ID),
             new PropValue(InternalSchema.RuleActions, value)
         };
         ruleTable.ModifyRow(propValues);
         ruleTable.ApplyPendingChanges();
     }
     base.Context.TraceDebug("Successfully updated the rule action with TemplateMessageId and/or Guid");
 }
        void IDestinationFolder.SetACL(SecurityProp secProp, PropValueData[][] aclData)
        {
            MrsTracer.Provider.Function("StorageDestinationFolder.SetACL: {0}, isNullAcl: {1}", new object[]
            {
                base.DisplayNameForTracing,
                aclData == null
            });
            if (aclData == null)
            {
                return;
            }
            ModifyTableOptions options = (secProp == SecurityProp.FreeBusyNTSD) ? ModifyTableOptions.FreeBusyAware : ModifyTableOptions.None;

            using (IModifyTable permissionTable = base.CoreFolder.GetPermissionTable(options))
            {
                permissionTable.Clear();
                foreach (PropValueData[] array in aclData)
                {
                    long?        num          = null;
                    byte[]       array2       = null;
                    MemberRights memberRights = MemberRights.None;
                    foreach (PropValueData propValueData in array)
                    {
                        int propTag = propValueData.PropTag;
                        if (propTag != 268370178)
                        {
                            if (propTag != 1718681620)
                            {
                                if (propTag == 1718812675)
                                {
                                    memberRights = (MemberRights)propValueData.Value;
                                }
                            }
                            else
                            {
                                num = new long?((long)propValueData.Value);
                            }
                        }
                        else
                        {
                            array2 = (byte[])propValueData.Value;
                        }
                    }
                    PropValue[] array3 = new PropValue[2];
                    array3[0] = new PropValue(PermissionSchema.MemberRights, memberRights);
                    if (num != null && (num.Value == 0L || num.Value == -1L))
                    {
                        array3[1] = new PropValue(PermissionSchema.MemberId, num);
                        permissionTable.ModifyRow(array3);
                    }
                    else if (array2 != null)
                    {
                        array3[1] = new PropValue(PermissionSchema.MemberEntryId, array2);
                        permissionTable.AddRow(array3);
                    }
                }
                using (base.Mailbox.RHTracker.Start())
                {
                    permissionTable.ApplyPendingChanges();
                }
            }
        }