Exemplo n.º 1
0
        /// <summary>
        /// Maps all the filled <see cref="Storage.Task"/> properties to the corresponding extended file attributes
        /// </summary>
        /// <param name="message">The <see cref="Storage.Message"/> object</param>
        /// <param name="propertyWriter">The <see cref="ShellPropertyWriter"/> object</param>
        private void MapTaskPropertiesToExtendedFileAttributes(Storage.Message message, ShellPropertyWriter propertyWriter)
        {
            // From
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromAddress, message.Sender.Email);
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromName, message.Sender.DisplayName);

            // Sent on
            propertyWriter.WriteProperty(SystemProperties.System.Message.DateSent, message.SentOn);

            // Subject
            propertyWriter.WriteProperty(SystemProperties.System.Subject, message.Subject);

            // Task startdate
            propertyWriter.WriteProperty(SystemProperties.System.StartDate, message.Task.StartDate);

            // Task duedate
            propertyWriter.WriteProperty(SystemProperties.System.DueDate, message.Task.DueDate);

            // Urgent
            propertyWriter.WriteProperty(SystemProperties.System.Importance, message.Importance);
            propertyWriter.WriteProperty(SystemProperties.System.ImportanceText, message.ImportanceText);

            // Status
            propertyWriter.WriteProperty(SystemProperties.System.Status, message.Task.StatusText);

            // Percentage complete
            propertyWriter.WriteProperty(SystemProperties.System.Task.CompletionStatus, message.Task.PercentageComplete);

            // Owner
            propertyWriter.WriteProperty(SystemProperties.System.Task.Owner, message.Task.Owner);

            // Categories
            propertyWriter.WriteProperty(SystemProperties.System.Category,
                message.Categories != null ? String.Join("; ", message.Categories) : null);

            // Companies
            propertyWriter.WriteProperty(SystemProperties.System.Company,
                message.Task.Companies != null ? String.Join("; ", message.Task.Companies) : null);

            // Billing information
            propertyWriter.WriteProperty(SystemProperties.System.Task.BillingInformation, message.Task.BillingInformation);

            // Mileage
            propertyWriter.WriteProperty(SystemProperties.System.MileageInformation, message.Task.Mileage);

            // Attachments
            var attachments = message.GetAttachmentNames();
            if (string.IsNullOrEmpty(attachments))
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, false);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, null);
            }
            else
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, true);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, attachments);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Maps all the filled <see cref="Storage.Message"/> properties to the corresponding extended file attributes
        /// </summary>
        /// <param name="message">The <see cref="Storage.Message"/> object</param>
        /// <param name="propertyWriter">The <see cref="ShellPropertyWriter"/> object</param>
        private void MapEmailPropertiesToExtendedFileAttributes(Storage.Message message, ShellPropertyWriter propertyWriter)
        {
            // From
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromAddress, message.Sender.Email);
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromName, message.Sender.DisplayName);

            // Sent on
            propertyWriter.WriteProperty(SystemProperties.System.Message.DateSent, message.SentOn);

            // To
            propertyWriter.WriteProperty(SystemProperties.System.Message.ToAddress,
                message.GetEmailRecipients(Storage.Recipient.RecipientType.To, false, false));

            // CC
            propertyWriter.WriteProperty(SystemProperties.System.Message.CcAddress,
                message.GetEmailRecipients(Storage.Recipient.RecipientType.Cc, false, false));

            // BCC
            propertyWriter.WriteProperty(SystemProperties.System.Message.BccAddress,
                message.GetEmailRecipients(Storage.Recipient.RecipientType.Bcc, false, false));

            // Subject
            propertyWriter.WriteProperty(SystemProperties.System.Subject, message.Subject);

            // Urgent
            propertyWriter.WriteProperty(SystemProperties.System.Importance, message.Importance);
            propertyWriter.WriteProperty(SystemProperties.System.ImportanceText, message.ImportanceText);

            // Attachments
            var attachments = message.GetAttachmentNames();
            if (string.IsNullOrEmpty(attachments))
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, false);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, null);
            }
            else
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, true);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, attachments);
            }

            // Clear properties
            propertyWriter.WriteProperty(SystemProperties.System.StartDate, null);
            propertyWriter.WriteProperty(SystemProperties.System.DueDate, null);
            propertyWriter.WriteProperty(SystemProperties.System.DateCompleted, null);
            propertyWriter.WriteProperty(SystemProperties.System.IsFlaggedComplete, null);
            propertyWriter.WriteProperty(SystemProperties.System.FlagStatusText, null);

            // Follow up
            if (message.Flag != null)
            {
                propertyWriter.WriteProperty(SystemProperties.System.IsFlagged, true);
                propertyWriter.WriteProperty(SystemProperties.System.FlagStatusText, message.Flag.Request);

                // Flag status text
                propertyWriter.WriteProperty(SystemProperties.System.FlagStatusText, message.Task.StatusText);

                // When complete
                if (message.Task.Complete != null && (bool)message.Task.Complete)
                {
                    // Flagged complete
                    propertyWriter.WriteProperty(SystemProperties.System.IsFlaggedComplete, true);

                    // Task completed date
                    if (message.Task.CompleteTime != null)
                        propertyWriter.WriteProperty(SystemProperties.System.DateCompleted, (DateTime)message.Task.CompleteTime);
                }
                else
                {
                    // Flagged not complete
                    propertyWriter.WriteProperty(SystemProperties.System.IsFlaggedComplete, false);

                    propertyWriter.WriteProperty(SystemProperties.System.DateCompleted, null);

                    // Task startdate
                    if (message.Task.StartDate != null)
                        propertyWriter.WriteProperty(SystemProperties.System.StartDate, (DateTime)message.Task.StartDate);

                    // Task duedate
                    if (message.Task.DueDate != null)
                        propertyWriter.WriteProperty(SystemProperties.System.DueDate, (DateTime)message.Task.DueDate);
                }
            }

            // Categories
            var categories = message.Categories;
            if (categories != null)
                propertyWriter.WriteProperty(SystemProperties.System.Category, String.Join("; ", String.Join("; ", categories)));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Maps all the filled <see cref="Storage.Appointment"/> properties to the corresponding extended file attributes
        /// </summary>
        /// <param name="message">The <see cref="Storage.Message"/> object</param>
        /// <param name="propertyWriter">The <see cref="ShellPropertyWriter"/> object</param>
        private void MapAppointmentPropertiesToExtendedFileAttributes(Storage.Message message, ShellPropertyWriter propertyWriter)
        {
            // From
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromAddress, message.Sender.Email);
            propertyWriter.WriteProperty(SystemProperties.System.Message.FromName, message.Sender.DisplayName);

            // Sent on
            if (message.SentOn != null)
                propertyWriter.WriteProperty(SystemProperties.System.Message.DateSent, message.SentOn);

            // Subject
            propertyWriter.WriteProperty(SystemProperties.System.Subject, message.Subject);

            // Location
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.Location, message.Appointment.Location);

            // Start
            propertyWriter.WriteProperty(SystemProperties.System.StartDate, message.Appointment.Start);

            // End
            propertyWriter.WriteProperty(SystemProperties.System.StartDate, message.Appointment.End);

            // Recurrence type
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.IsRecurring,
                message.Appointment.ReccurrenceType != Storage.Appointment.AppointmentRecurrenceType.None);

            // Status
            propertyWriter.WriteProperty(SystemProperties.System.Status, message.Appointment.ClientIntentText);

            // Appointment organizer (FROM)
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.OrganizerAddress, message.Sender.Email);
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.OrganizerName, message.Sender.DisplayName);

            // Mandatory participants (TO)
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.RequiredAttendeeNames, message.Appointment.ToAttendees);

            // Optional participants (CC)
            propertyWriter.WriteProperty(SystemProperties.System.Calendar.OptionalAttendeeNames, message.Appointment.CclAttendees);

            // Categories
            var categories = message.Categories;
            if (categories != null)
                propertyWriter.WriteProperty(SystemProperties.System.Category, String.Join("; ", String.Join("; ", categories)));

            // Urgent
            propertyWriter.WriteProperty(SystemProperties.System.Importance, message.Importance);
            propertyWriter.WriteProperty(SystemProperties.System.ImportanceText, message.ImportanceText);

            // Attachments
            var attachments = message.GetAttachmentNames();
            if (string.IsNullOrEmpty(attachments))
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, false);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, null);
            }
            else
            {
                propertyWriter.WriteProperty(SystemProperties.System.Message.HasAttachments, true);
                propertyWriter.WriteProperty(SystemProperties.System.Message.AttachmentNames, attachments);
            }
        }