Home All Groups Group Topic Archive Search About

Instance of derived class does not show public methods or properties that are not in the inherited c

Author
27 Mar 2006 9:34 PM
D Witherspoon
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail.MailMessage

Project 1 references Project 2,
Project 2 references Project 3.

When I declare an instance of "ClassA" in a thrid project I get all of the
public methods/properties that are in the System.Net.Mail.MailMessage class,
but I do not get any of the public methods or properties that are
specirfically declared in Class B

Has anyone seen this before or could help me along in this situation?
Thanks...

I am using VS.NET 2005.


PROJECT 3
=========
Public MustInherit Class EmailMessage_Base

Inherits System.Net.Mail.MailMessage

Public Sub New()

    mybase.new()

End Sub

Public Sub Test

End Sub

End Class



PROJECT 2
==========

Public Class EmailMessage

Inherits Project3.EmailMessage_Base

Public Sub New()

    MyBase.New()

''''typing in me. brings up Test in the intellisense to the class at least
knows it is there
End Sub

End Class



PROJECT 1
=========

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim mail As New Project2.EmailMessage()

mail.From = New System.Net.Mail.MailAddress("someem***@email.com")

mail.To.Add("test")

mail.Bcc.Add("t***@test.com")

mail.CC.Add("b***@psfdgfdgsfdgtran.comm")

mail.Subject = "sdfgs"

mail.Body = "testing"

mail.Test '<--------------Test does not show up in the list of methods in
the intellisense


End Sub

End Class

Author
28 Mar 2006 2:24 PM
Cowboy (Gregory A. Beamer) - MVP
Reference project 3 in project 1 or set up an override and call base in
Project2.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


Show quoteHide quote
"D Witherspoon" wrote:

> What is happening is that I have a class (ClassA) that inherits a class
> (ClassB) which inherits System.Net.Mail.MailMessage
>
> Project 1 references Project 2,
> Project 2 references Project 3.
>
> When I declare an instance of "ClassA" in a thrid project I get all of the
> public methods/properties that are in the System.Net.Mail.MailMessage class,
> but I do not get any of the public methods or properties that are
> specirfically declared in Class B
>
> Has anyone seen this before or could help me along in this situation?
> Thanks...
>
> I am using VS.NET 2005.
>
>
> PROJECT 3
> =========
> Public MustInherit Class EmailMessage_Base
>
> Inherits System.Net.Mail.MailMessage
>
> Public Sub New()
>
>     mybase.new()
>
> End Sub
>
> Public Sub Test
>
> End Sub
>
> End Class
>
>
>
> PROJECT 2
> ==========
>
> Public Class EmailMessage
>
> Inherits Project3.EmailMessage_Base
>
> Public Sub New()
>
>     MyBase.New()
>
>  ''''typing in me. brings up Test in the intellisense to the class at least
> knows it is there
> End Sub
>
> End Class
>
>
>
> PROJECT 1
> =========
>
> Public Class Form1
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
>  Dim mail As New Project2.EmailMessage()
>
>  mail.From = New System.Net.Mail.MailAddress("someem***@email.com")
>
>  mail.To.Add("test")
>
>  mail.Bcc.Add("t***@test.com")
>
>  mail.CC.Add("b***@psfdgfdgsfdgtran.comm")
>
>  mail.Subject = "sdfgs"
>
>  mail.Body = "testing"
>
>  mail.Test '<--------------Test does not show up in the list of methods in
> the intellisense
>
>
> End Sub
>
> End Class
>
>
>
Author
28 Mar 2006 2:28 PM
D Witherspoon
Could you explain what the logic behind this is?  Or help me understand...

Why would Project 3 have to reference Project 1?  If it is inheriting,
shouldn't Project 3 be able to use all the members that the class in Project
2 is inheriting already?




Show quoteHide quote
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@comcast.netNoSpamM> wrote
in message news:0299E119-4691-4868-BAA0-5B8DE8E4AB08@microsoft.com...
> Reference project 3 in project 1 or set up an override and call base in
> Project2.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "D Witherspoon" wrote:
>
>> What is happening is that I have a class (ClassA) that inherits a class
>> (ClassB) which inherits System.Net.Mail.MailMessage
>>
>> Project 1 references Project 2,
>> Project 2 references Project 3.
>>
>> When I declare an instance of "ClassA" in a thrid project I get all of
>> the
>> public methods/properties that are in the System.Net.Mail.MailMessage
>> class,
>> but I do not get any of the public methods or properties that are
>> specirfically declared in Class B
>>
>> Has anyone seen this before or could help me along in this situation?
>> Thanks...
>>
>> I am using VS.NET 2005.
>>
>>
>> PROJECT 3
>> =========
>> Public MustInherit Class EmailMessage_Base
>>
>> Inherits System.Net.Mail.MailMessage
>>
>> Public Sub New()
>>
>>     mybase.new()
>>
>> End Sub
>>
>> Public Sub Test
>>
>> End Sub
>>
>> End Class
>>
>>
>>
>> PROJECT 2
>> ==========
>>
>> Public Class EmailMessage
>>
>> Inherits Project3.EmailMessage_Base
>>
>> Public Sub New()
>>
>>     MyBase.New()
>>
>>  ''''typing in me. brings up Test in the intellisense to the class at
>> least
>> knows it is there
>> End Sub
>>
>> End Class
>>
>>
>>
>> PROJECT 1
>> =========
>>
>> Public Class Form1
>>
>> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>>
>>  Dim mail As New Project2.EmailMessage()
>>
>>  mail.From = New System.Net.Mail.MailAddress("someem***@email.com")
>>
>>  mail.To.Add("test")
>>
>>  mail.Bcc.Add("t***@test.com")
>>
>>  mail.CC.Add("b***@psfdgfdgsfdgtran.comm")
>>
>>  mail.Subject = "sdfgs"
>>
>>  mail.Body = "testing"
>>
>>  mail.Test '<--------------Test does not show up in the list of methods
>> in
>> the intellisense
>>
>>
>> End Sub
>>
>> End Class
>>
>>
>>