/// <summary> /// Writes all <see cref="Property">properties</see> either as a <see cref="CFStream"/> or as a collection in /// a <see cref="PropertyTags.PropertiesStreamName"/> stream to the given <paramref name="storage"/>, this depends /// on the <see cref="PropertyType"/> /// </summary> /// <remarks> /// See the <see cref="Properties"/> class it's <see cref="Properties.WriteProperties"/> method for the logic /// that is used to determine this /// </remarks> /// <param name="storage">The <see cref="CFStorage"/></param> /// <returns> /// Total size of the written <see cref="Recipient"/> object and it's <see cref="Properties"/> /// </returns> internal long WriteProperties(CFStorage storage) { var propertiesStream = new RecipientProperties(); propertiesStream.AddProperty(PropertyTags.PR_ROWID, RowId); propertiesStream.AddProperty(PropertyTags.PR_ENTRYID, Mapi.GenerateEntryId()); propertiesStream.AddProperty(PropertyTags.PR_INSTANCE_KEY, Mapi.GenerateInstanceKey()); propertiesStream.AddProperty(PropertyTags.PR_RECIPIENT_TYPE, RecipientType); propertiesStream.AddProperty(PropertyTags.PR_ADDRTYPE_W, AddressTypeString); propertiesStream.AddProperty(PropertyTags.PR_EMAIL_ADDRESS_W, Email); propertiesStream.AddProperty(PropertyTags.PR_OBJECT_TYPE, ObjectType); propertiesStream.AddProperty(PropertyTags.PR_DISPLAY_TYPE, DisplayType); propertiesStream.AddProperty(PropertyTags.PR_DISPLAY_NAME_W, DisplayName); propertiesStream.AddProperty(PropertyTags.PR_SEARCH_KEY, Mapi.GenerateSearchKey(AddressTypeString, Email)); return(propertiesStream.WriteProperties(storage)); }