DeleteRuleOperation クラス

定義

受信トレイ ルールを削除する操作を表します。

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
継承
DeleteRuleOperation

次の例では、 クラスを RuleCollection 検索して、ユーザーのメールボックスから "MoveInterestingToJunk" という名前の既存 Rule のオブジェクトを検索します。 が Rule 存在する場合は、サービスの実行時に が Rule 削除されます。UpdateInboxRules(new 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

削除するルールの一意の識別子を取得または設定します。

適用対象