Dart.Mail Namespace > Mailbox Class > Update Method : Update(Int32,Int32,Boolean,ImapFlags) Method |
Public Overloads Function Update( _ ByVal startIndex As Integer, _ ByVal length As Integer, _ ByVal set As Boolean, _ ByVal flags As ImapFlags _ ) As ImapResponse
Dim instance As Mailbox Dim startIndex As Integer Dim length As Integer Dim set As Boolean Dim flags As ImapFlags Dim value As ImapResponse value = instance.Update(startIndex, length, set, flags)
public ImapResponse Update( int startIndex, int length, bool set, ImapFlags flags )
public: ImapResponse* Update( int startIndex, int length, bool set, ImapFlags flags )
public: ImapResponse^ Update( int startIndex, int length, bool set, ImapFlags flags )
Exception | Description |
---|---|
ProtocolException | Bad IMAP protocol response received from server. |
System.Net.Sockets.SocketException | A communications failure has occurred. |
System.ArgumentOutOfRangeException | index was out of range |
System.IndexOutOfRangeException | index was outside bounds of array |
/// <summary> /// Sets the delete flag on a range of messages, and optionally deletes them immediately. /// </summary> /// <param name="myImap">A connected and authenticated Imap instance.</param> /// <param name="startIndex">The index of the first message to delete. Corresponds to the index of the message in myImap.SelectedMailbox.</param> /// <param name="length">The number of messages after startIndex to delete.</param> /// <param name="purge">True to delete immediately. False to not delete immediately; wait until logout or a subsequent call to Purge().</param> public void DeleteMessages(Imap myImap, int startIndex, int length, bool purge) { myImap.SelectedMailbox.Update(startIndex, length, true, ImapFlags.Deleted); if (purge) myImap.SelectedMailbox.Purge(); } /// <summary> /// Sets the delete flag on the specified messages, and optionally deletes them immediately. /// </summary> /// <param name="myImap">A connected and authenticated Imap instance.</param> /// <param name="messages">An array of messages from myImap.SelectedMailbox to delete.</param> /// <param name="purge">True to delete immediately. False to not delete immediately; wait until logout or a subsequent call to Purge().</param> public void DeleteMessages(Imap myImap, ImapMessage[] messages, bool purge) { myImap.SelectedMailbox.Update(messages, true, ImapFlags.Deleted); if (purge) myImap.SelectedMailbox.Purge(); }
''' <summary> ''' Sets the delete flag on a range of messages, and optionally deletes them immediately. ''' </summary> ''' <param name="myImap">A connected and authenticated Imap instance.</param> ''' <param name="startIndex">The index of the first message to delete. Corresponds to the index of the message in myImap.SelectedMailbox.</param> ''' <param name="length">The number of messages after startIndex to delete.</param> ''' <param name="purge">True to delete immediately. False to not delete immediately; wait until logout or a subsequent call to Purge().</param> Public Sub DeleteMessages(ByVal myImap As Imap, ByVal startIndex As Integer, ByVal length As Integer, ByVal purge As Boolean) myImap.SelectedMailbox.Update(startIndex, length, True, ImapFlags.Deleted) If purge Then myImap.SelectedMailbox.Purge() End If End Sub ''' <summary> ''' Sets the delete flag on the specified messages, and optionally deletes them immediately. ''' </summary> ''' <param name="myImap">A connected and authenticated Imap instance.</param> ''' <param name="messages">An array of messages from myImap.SelectedMailbox to delete.</param> ''' <param name="purge">True to delete immediately. False to not delete immediately; wait until logout or a subsequent call to Purge().</param> Public Sub DeleteMessages(ByVal myImap As Imap, ByVal messages() As ImapMessage, ByVal purge As Boolean) myImap.SelectedMailbox.Update(messages, True, ImapFlags.Deleted) If purge Then myImap.SelectedMailbox.Purge() End If End Sub