DeleteRuleOperation 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示删除收件箱规则的操作。
public ref class DeleteRuleOperation sealed : Microsoft::Exchange::WebServices::Data::RuleOperation
public sealed class DeleteRuleOperation : Microsoft.Exchange.WebServices.Data.RuleOperation
Public NotInheritable Class DeleteRuleOperation
Inherits RuleOperation
- 继承
示例
以下示例搜索 类, RuleCollection 以查找用户邮箱中名为“MoveInterestingToJunk”的现有 Rule 对象。 Rule如果 存在,Rule则会在服务时删除 。UpdateInboxRules (新的 RuleOperation[] { setRuleOperation }, true) 行执行。
// Create the DeleteRuleOperation.
// Delete the rule "MoveInterestingToJunk", if it exists.
// Get the RuleCollection.
RuleCollection ruleCollection = service.GetInboxRules("User1@Contoso.com");
foreach (Rule ruleinCollection in ruleCollection)
{
if (ruleinCollection.DisplayName == "MoveInterestingToJunk")
{
DeleteRuleOperation deleteRuleOperation = new DeleteRuleOperation(ruleinCollection.Id);
service.UpdateInboxRules(new RuleOperation[] { deleteRuleOperation }, true);
}
}
注解
可以使用此类删除现有 Rule 类对象。
此类派生自 RuleOperation 类。
构造函数
DeleteRuleOperation() |
初始化 DeleteRuleOperation 类的新实例。 |
DeleteRuleOperation(String) |
使用指定的规则标识符初始化 DeleteRuleOperation 类的新实例。 |
属性
RuleId |
获取或设置要删除的规则的唯一标识符。 |