Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[1047] New Object-Oriented Capabilities in VB.NET

Last post 05-12-2005 1:06 AM by aussieVB. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [1047] New Object-Oriented Capabilities in VB.NET

    This thread is for discussions of New Object-Oriented Capabilities in VB.NET.

    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 11-01-2002 6:35 AM In reply to

    Scoping with ASP.NET

    If you set a shared property of a user class in a ASP.NET application, how long wil the value last? Application level? Session level? Page level? Well i was actually looking for an answer to that when i got here...  useful article anyway even though it doesn't answer my question...
    • Post Points: 0
  • 11-21-2002 4:46 AM In reply to

    • boig
    • Not Ranked
    • Joined on 11-21-2002
    • New Member
    • Points 10

    global variable

    I need a global variable; but it is a "XmlDocument" object, does anybody know how do I have to create it, and how to initialitze it?
    • Post Points: 0
  • 02-24-2003 8:50 AM In reply to

    • gshuston
    • Not Ranked
    • Joined on 02-24-2003
    • New Member
    • Points 5

    Global Variable Declaration

    boig,

    I needed the same thing and found that I have it working using the Public Shared declaration on the class that contains my XMLDocument and the functions to access the document.  This makes the class available across the application.

    Public Shared  oTriggers As Triggers

    If you only need the XMLDocument I would give that a try.

    Hope this helps.
    • Post Points: 0
  • 07-02-2003 3:14 AM In reply to

    VB.NET

    How do we read the attributes in an XML file using a DataSet?
    • Post Points: 0
  • 03-19-2004 4:06 PM In reply to

    • bsol
    • Not Ranked
    • Joined on 03-19-2004
    • New Member
    • Points 10

    raising base class events

    Error in the article "New Object-Oriented Capabilities in VB.NET - Events"

    Derived classes cannot raise base class events in VB.Net. Handle them sure, but not raise them - even if they are declared public. In order to achieve this handle the base class event and raise a derived class event instead.

    B.
    • Post Points: 0
  • 11-04-2004 12:10 PM In reply to

    raising base class events

    Quote:
    [1]Posted by bsol on 19 Mar 2004 04:06 PM[/1]
    Error in the article "New Object-Oriented Capabilities in VB.NET - Events"

    Derived classes cannot raise base class events in VB.Net. Handle them sure, but not raise them - even if they are declared public. In order to achieve this handle the base class event and raise a derived class event instead.

    B.


    While it is true that VB.NET cannot directly raise events in base classes from a derived class, there is an easy workaround. BTW, in C# you can simply call an event in a base class like: base.onMyEventName(EventArgs e).

    But in VB.NET you cannot use MyBase.EventName() at all. But the workaround is an easy one.
    1) In the base class add an overridable sub that simply raises an event defined in the base class.


    Public MustInherit Class MyClass

     Protected Event MyEventName(ByVal e as EventArgs)

     Protected Overridable Sub OnMyEventName(ByVal e as EventArgs)
         Raiseevent MyEventName(e)
     End Sub

    End Class

    2) In the derived class make a call to the overridable method: Me.OnMyEventName(New EventArgs). It's really just that easy. Do it all the time.

    Have Fun....
    • Post Points: 0
  • 05-12-2005 1:06 AM In reply to

    • aussieVB
    • Not Ranked
    • Joined on 05-12-2005
    • New Member
    • Points 5
    application level
    • Post Points: 0
Page 1 of 1 (8 items)