• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class ImapMessageSet

Represents a set of IMAP messages addressed by sequence number or UID (RFC 9051 §9). Produces the compact command-string form with range collapsing (e.g. 1,2,3 → 1:3).

Inheritance
object
ImapMessageSet
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Imap
Assembly: DRIT.Mail.dll
Syntax
public sealed class ImapMessageSet

Properties

View Source

IsUid

Gets a value indicating whether this set addresses messages by UID (true) or by sequence number (false).

Declaration
public bool IsUid { get; }
Property Value
Type Description
bool

Methods

View Source

All()

Creates a set matching all messages (1:*).

Declaration
public static ImapMessageSet All()
Returns
Type Description
ImapMessageSet
View Source

FromSequenceNumbers(IEnumerable<long>)

Creates a set from a collection of sequence numbers.

Declaration
public static ImapMessageSet FromSequenceNumbers(IEnumerable<long> numbers)
Parameters
Type Name Description
IEnumerable<long> numbers

Specifies the numbers value.

Returns
Type Description
ImapMessageSet
View Source

FromUids(IEnumerable<long>)

Creates a set from a collection of UIDs. Produces a UID FETCH / UID STORE / UID SEARCH command.

Declaration
public static ImapMessageSet FromUids(IEnumerable<long> uids)
Parameters
Type Name Description
IEnumerable<long> uids

Specifies the uids value.

Returns
Type Description
ImapMessageSet
View Source

Range(long, long)

Creates a set containing a contiguous range of messages.

Declaration
public static ImapMessageSet Range(long from, long to)
Parameters
Type Name Description
long from

The first number (inclusive). Use 0 for *.

long to

The last number (inclusive). Use 0 for *.

Returns
Type Description
ImapMessageSet
View Source

Single(long)

Creates a set containing a single message.

Declaration
public static ImapMessageSet Single(long number)
Parameters
Type Name Description
long number

The 1-based sequence number or UID.

Returns
Type Description
ImapMessageSet
View Source

ToCommandString()

Returns the command-string form (e.g. 1, 1:5, 2,4,6, 1:*).

Declaration
public string ToCommandString()
Returns
Type Description
string
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX