Share via


MailTransport.MaxTotalMessageCountInCache Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the maximum number of messages that can be stored in the mail transport's cache.

Namespace:  Microsoft.ServiceModel.Channels.Mail
Assembly:  Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)

Syntax

'Declaration
Public Property MaxTotalMessageCountInCache As Integer
    Get
    Set
'Usage
Dim instance As MailTransport
Dim value As Integer

value = instance.MaxTotalMessageCountInCache

instance.MaxTotalMessageCountInCache = value
public int MaxTotalMessageCountInCache { get; set; }
public:
property int MaxTotalMessageCountInCache {
    int get ();
    void set (int value);
}
member MaxTotalMessageCountInCache : int with get, set

Property Value

Type: System.Int32
The maximum number of messages that can be stored in the mail transport's cache. On the desktop, the default value is 4,096. On a Windows Mobile device, the default value is 64.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The MaxTotalMessageCountInCache property is set to a value that is less than 0 (zero).

Remarks

The in-memory cache, which is a separate cache from the e-mail store, helps improve performance by reducing the number of hits on the file system and on Web services.

To get or set the maximum size of the cache, use the MaxTotalMessageCacheSize property.

Examples

The following example shows how to use the MaxTotalMessageCountInCache property.

' For a desktop application, use ExchangeWebServiceMailBinding.
binding = New WindowsMobileMailBinding()

binding.MinimumAttachmentSize = 1024
' Set lifetime to 1 day, 10 hours, 20 minutes, and 30 seconds.
binding.TimeToLive = New TimeSpan(1, 10, 20, 30)
binding.Transport.ReceiveRetryCount = 5
binding.Transport.MaxTotalMessageCacheSize = 1000
binding.Transport.MaxTotalMessageCountInCache = 128
// For a desktop application, use ExchangeWebServiceMailBinding.
binding = new WindowsMobileMailBinding();

binding.MinimumAttachmentSize = 1024;
// Set lifetime to 1 day, 10 hours, 20 minutes, and 30 seconds.
binding.TimeToLive = new TimeSpan(1, 10, 20, 30);
binding.Transport.ReceiveRetryCount = 5;
binding.Transport.MaxTotalMessageCacheSize = 1000;
binding.Transport.MaxTotalMessageCountInCache = 128;

.NET Framework Security

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5

See Also

Reference

MailTransport Class

MailTransport Members

Microsoft.ServiceModel.Channels.Mail Namespace