private AddressBook CreateAddressBookWithOneEntryAndOneDataItem(bool dataItemIsEnabled)
        {
            AddressBook addressBook = new AddressBook();

            AddressBookEntry entry = new AddressBookEntry();
            entry.FirstName = "John";
            entry.LastName = "Doe";

            MailAddressEntryObject data = new MailAddressEntryObject() { Address = new MailAddress("*****@*****.**") };
            entry.Data.Add(new EntryDataItem() { Data = data, Identifier = MailEntryObjectTypeIdentifier, IsEnabled = dataItemIsEnabled });

            addressBook.Entries.Add(entry);

            return addressBook;
        }
        /// <summary>
        /// Parses a specified address and recipient type into a <see cref="MailAddressEntryObject"/>-instance.
        /// </summary>
        /// <param name="address">The e-mail address to parse.</param>
        /// <param name="receiptType">The receipt type.</param>
        /// <returns></returns>
        public static MailAddressEntryObject FromAddress(string address, string receiptType)
        {
            MailAddressEntryObject returnValue = new MailAddressEntryObject();
            returnValue.Address = TryParseMailAddress(address);
            if (returnValue.Address == null)
            {
                return null;
            }

            ReceiptType receiptTypeEnum = ReceiptType.To;
            if (!Enum.TryParse<ReceiptType>(receiptType, true, out receiptTypeEnum))
            {
                return null;
            }

            returnValue.Type = receiptTypeEnum;

            return returnValue;
        }
        /// <summary>
        /// Parses a specified address and recipient type into a <see cref="MailAddressEntryObject"/>-instance.
        /// </summary>
        /// <param name="address">The e-mail address to parse.</param>
        /// <param name="receiptType">The receipt type.</param>
        /// <returns></returns>
        public static MailAddressEntryObject FromAddress(string address, string receiptType)
        {
            MailAddressEntryObject returnValue = new MailAddressEntryObject();

            returnValue.Address = TryParseMailAddress(address);
            if (returnValue.Address == null)
            {
                return(null);
            }

            ReceiptType receiptTypeEnum = ReceiptType.To;

            if (!Enum.TryParse <ReceiptType>(receiptType, true, out receiptTypeEnum))
            {
                return(null);
            }

            returnValue.Type = receiptTypeEnum;

            return(returnValue);
        }