Property in Class

S

shapper

Hello,

I am creating a custom email class and I have a property as follows:

Private _BccCollection As Mail.MailAddressCollection
Public WriteOnly Property BccCollection() As
Mail.MailAddressCollection
Set(ByVal value As Mail.MailAddressCollection)
_BccCollection = value
End Set
End Property

Now I have a function named Email_Send()

Public Function Email_Send()

Dim email As New System.Net.Mail.MailMessage
email.Bcc = _Bcc
...

End Function

I am getting an error in "email.Bcc = _Bcc".

I know I should do something like email.Bcc.Add( addresses )

But if I am passing a collection ...

Maybe I am also following a wrong method to create this.

Can someone help me out?

Thanks,

Miguel
 
C

Cowboy \(Gregory A. Beamer\)

If you are passing a collection, you are correct. You simply overwrite the
inner value (private var). You should still have an Add method, however.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Default value 1
Check if an object is null 4
Custom Class 3
Class Question 1
Control Property. 3
Property 1
Sub Properties 3
Property Default Value 1

Top