// // MessageThread.cs // // Author: Jeffrey Stedfast // // Copyright (c) 2013-2020 .NET Foundation and Contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using System.Collections.Generic; namespace MailKit { /// /// A message thread. /// /// /// A message thread. /// public class MessageThread { /// /// Initializes a new instance of the class. /// /// /// Creates a new message thread node. /// /// The unique identifier of the message. public MessageThread (UniqueId? uid) { Children = new List (); UniqueId = uid; } /// /// Initializes a new instance of the class. /// /// /// Creates a new message thread node. /// /// The message summary. public MessageThread (IMessageSummary message) { Children = new List (); if (message != null && message.UniqueId.IsValid) UniqueId = message?.UniqueId; Message = message; } /// /// Gets the message summary, if available. /// /// /// Gets the message summary, if available. /// This property will only ever be set if the /// was created by the . s that are /// created by any of the /// Thread or /// ThreadAsync /// methods will always be null. /// /// The message summary. public IMessageSummary Message { get; private set; } /// /// Gets the unique identifier of the message. /// /// /// The unique identifier may be null if the message is missing from the /// or from the list of messages provided to the /// . /// /// The unique identifier. public UniqueId? UniqueId { // FIXME: this shouldn't be a nullable since we can just use UniqueId.Invalid get; private set; } /// /// Gets the children. /// /// /// Each child represents a reply to the message referenced by . /// /// The children. public IList Children { get; private set; } } }