다음을 통해 공유


DeclineItemType Class

The DeclineItemType class represents a decline item response object that is used to reply to a meeting request or calendar item.

Namespace: ExchangeWebServices
Assembly: EWS (in ews.dll)

Syntax

'Declaration
<SerializableAttribute> _
<GeneratedCodeAttribute("wsdl", "2.0.50727.42")> _
<DebuggerStepThroughAttribute> _
<DesignerCategoryAttribute("code")> _
<XmlTypeAttribute(Namespace:="https://schemas.microsoft.com/exchange/services/2006/types")> _
Public Class DeclineItemType
    Inherits WellKnownResponseObjectType
[SerializableAttribute] 
[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
[DebuggerStepThroughAttribute] 
[DesignerCategoryAttribute("code")] 
[XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types")] 
public class DeclineItemType : WellKnownResponseObjectType
[SerializableAttribute] 
[GeneratedCodeAttribute(L"wsdl", L"2.0.50727.42")] 
[DebuggerStepThroughAttribute] 
[DesignerCategoryAttribute(L"code")] 
[XmlTypeAttribute(Namespace=L"https://schemas.microsoft.com/exchange/services/2006/types")] 
public ref class DeclineItemType : public WellKnownResponseObjectType
/** @attribute SerializableAttribute() */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types") */ 
public class DeclineItemType extends WellKnownResponseObjectType
SerializableAttribute 
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
DebuggerStepThroughAttribute 
DesignerCategoryAttribute("code") 
XmlTypeAttribute(Namespace="https://schemas.microsoft.com/exchange/services/2006/types") 
public class DeclineItemType extends WellKnownResponseObjectType

Remarks

To decline a meeting request or calendar item, you must follow these steps:

  1. Find the meeting request or calendar item by using a FindItem operation.

  2. Get the item identifier of the meeting request or calendar item.

  3. Pass the item identifier of the meeting request or calendar item to the ReferenceItemId property of the DeclineItemType.

  4. Call the CreateItem Operation by using the DeclineItemType response object type to decline the meeting request or calendar item.

Note

A user cannot decline a meeting request or calendar item for which the user is the organizer.

Inheritance Hierarchy

System.Object
   ExchangeWebServices.ItemType
     ExchangeWebServices.MessageType
       ExchangeWebServices.ResponseObjectCoreType
         ExchangeWebServices.ResponseObjectType
           ExchangeWebServices.WellKnownResponseObjectType
            ExchangeWebServices.DeclineItemType

Example

The following example shows you how to decline a meeting request. The item identifier of the meeting request is used in the ReferenceItemId property.

static void DeclineItem(ExchangeServiceBinding esb)
{
    // Create the request.
    CreateItemType request = new CreateItemType();

    // Set the message disposition on the request.
    request.MessageDisposition = MessageDispositionType.SendAndSaveCopy;
    request.MessageDispositionSpecified = true;

    // Create the DeclineItem response object.
    DeclineItemType declineItem = new DeclineItemType();

    // Identify the meeting request to decline.
    declineItem.ReferenceItemId = new ItemIdType();
    declineItem.ReferenceItemId.Id = "AAArAG1z";

    // Add the DeclineItem response object to the request.
    request.Items = new NonEmptyArrayOfAllItemsType();
    request.Items.Items = new ItemType[1];
    request.Items.Items[0] = declineItem;

    // Send the request and get the response.
    CreateItemResponseType response = esb.CreateItem(request);

    ArrayOfResponseMessagesType aormt = response.ResponseMessages;
    ResponseMessageType[] rmta = aormt.Items;

    foreach (ResponseMessageType rmt in rmta)
    {
        ItemInfoResponseMessageType iirmt = (rmt as ItemInfoResponseMessageType);
        if (iirmt.ResponseClass == ResponseClassType.Success)
        {
            Console.WriteLine("Successfully declined meeting");
        }
    }
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Longhorn, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2)