private static MessageFlags UpdateMessageFlags(IPropertyBag propertyBag, MessageFlags flagsFromSource) { MessageFlags messageFlags = MessageFlags.None; AnnotatedPropertyValue annotatedProperty = propertyBag.GetAnnotatedProperty(PropertyTag.MessageFlags); if (!annotatedProperty.PropertyValue.IsError) { messageFlags = (MessageFlags)((int)annotatedProperty.PropertyValue.Value); } if (flagsFromSource.HasFlag(MessageFlags.Read)) { messageFlags |= MessageFlags.Read; } else { messageFlags &= ~MessageFlags.Read; } if (flagsFromSource.HasFlag(MessageFlags.Unsent)) { messageFlags |= MessageFlags.Unsent; } else { messageFlags &= ~MessageFlags.Unsent; } return(messageFlags); }
private static bool ShouldUpdateIconIndex(IPropertyBag propertyBag, IconIndex iconIndexFromSource) { if (iconIndexFromSource.Equals(IconIndex.BaseMail)) { AnnotatedPropertyValue annotatedProperty = propertyBag.GetAnnotatedProperty(new PropertyTag(276824067U)); if (annotatedProperty.PropertyValue.IsError) { return(false); } IconIndex iconIndex = (IconIndex)annotatedProperty.PropertyValue.Value; if (iconIndex != IconIndex.MailReplied && iconIndex != IconIndex.MailForwarded) { return(false); } } return(true); }