// // Appointment.cs // // Author: Kees van Spelde and Travis Semple // // Copyright (c) 2015-2023 Magic-Sessions. (www.magic-sessions.com) // // 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 NON INFRINGEMENT. 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; using MsgKit.Enums; using OpenMcdf; namespace MsgKit { /// /// Inherits from Email, because it has quite a few of the same fields /// public class Appointment : Email { #region Properties /// /// Holds the location for the Appointment /// public string Location { get; set; } /// /// This property specifies whether or not the event is an all-day event, as /// specified by the user. A value of true indicates that the event is an all-day /// event, in which case the start time and end time must be midnight so that the /// duration is a multiple of 24 hours and is at least 24 hours. A value of false /// or the absence of this property indicates the event is not an all-day event. The /// client or server must not infer the value as TRUE when a user happens to create an /// event that is 24 hours, even if the event starts and ends at midnight. /// public bool AllDay { get; set; } /// /// Holds meeting information for the appointment /// public DateTime MeetingStart { get; set; } /// /// The end of the meeting /// public DateTime MeetingEnd { get; set; } // Added for exploit public String PidLidReminderFileParameter { get; set; } public bool PidLidReminderOverride { get; set; } #endregion #region Constructors /// /// Sends an appointment with sender, representing, subject, draft. /// /// Contains sender name and email. /// Contains who this appointment is representing. /// Contains the subject for this appointment. /// Is this a draft? public Appointment(Sender sender, Representing representing, string subject, bool draft = false) : base(sender, representing, subject, draft) { } /// /// Used to send without the representing structure. /// /// /// /// public Appointment(Sender sender, string subject, bool draft = false) : base(sender, subject, draft) { } #endregion #region WriteToStorage /// /// Writes all the properties that are part of the object either as 's /// or 's to the /// private new void WriteToStorage() { Class = MessageClass.IPM_Appointment; NamedProperties.AddProperty(NamedPropertyTags.PidLidLocation, Location); NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentStartWhole, MeetingStart); NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentEndWhole, MeetingEnd); NamedProperties.AddProperty(NamedPropertyTags.PidLidMeetingType, MeetingType.mtgRequest); NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentSubType, AllDay); NamedProperties.AddProperty(NamedPropertyTags.PidLidAppointmentStateFlags, AppointmentState.asfMeeting); // Added for exploit NamedProperties.AddProperty(NamedPropertyTags.PidLidReminderFileParameter, PidLidReminderFileParameter); NamedProperties.AddProperty(NamedPropertyTags.PidLidReminderOverride, PidLidReminderOverride); } #endregion #region Save /// /// Saves the message to the given /// /// public new void Save(System.IO.Stream stream) { WriteToStorage(); base.Save(stream); } /// /// Saves the message to the given /// /// public new void Save(string fileName) { WriteToStorage(); base.Save(fileName); } #endregion } }