다음을 통해 공유


GetUserOofSettingsRequest Class

The GetUserOofSettingsRequest class represents a request to get a user's Out of Office (OOF) settings.

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

Syntax

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

Remarks

If the OOF message is set by Microsoft Office Outlook, this operation will return the OOF message in HTML format.

Inheritance Hierarchy

System.Object
   ExchangeWebServices.BaseRequestType
    ExchangeWebServices.GetUserOofSettingsRequest

Example

The following example shows you how to form a GetUserOofSettings request and receive the response.

static void GetOOF(ExchangeServiceBinding esb)
{
    // Create the request.
    GetUserOofSettingsRequest request = new GetUserOofSettingsRequest();
    request.Mailbox = new EmailAddress();
    request.Mailbox.Address = "someone@example.com";

    try
    {
        // Send the request and get the response.
        GetUserOofSettingsResponse response = esb.GetUserOofSettings(request);
        if (response.ResponseMessage.ResponseClass == ResponseClassType.Success)
        {
            if (response.AllowExternalOofSpecified)
            {
                Console.WriteLine("External OOF enabled for: " + response.AllowExternalOof);
            }

            // Display OOF information.
            Duration dur = response.OofSettings.Duration;
            Console.WriteLine("OOF start time: " + dur.StartTime.ToString());
            Console.WriteLine("OOF end time: " + dur.EndTime.ToString());

            Console.WriteLine("OOF state: " + response.OofSettings.OofState);
            Console.WriteLine("External reply: " + response.OofSettings.ExternalReply.Message);
            Console.WriteLine("Internal reply: " + response.OofSettings.InternalReply.Message);
        }
    }
    catch (Exception e)
    { 
        Console.WriteLine(e.Message); 
    }
}

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)