Link to home
Start Free TrialLog in
Avatar of iangregson1
iangregson1

asked on

Overriding a method, how to know signature?

hi there,

i wonder if anyone can help, i am overriding a couple of methods from a class... but is there anyway to easily create the method without having to look at the object browser to know the signature..

intellisense doesn't seem to provide me with the signature of the method i am ovverriding so i don't know which parameters to include?

Any ideas?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of imitchie
imitchie
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you are inheriting from an abstract class, you can type a skeleton like so

public class MyTest : AbstractClass {}

then hover over the A in "AbstractClass".
choose: implement abstract class "AbstractClass"

if it's inheriting a concrete class, then you create the class first.  When you start  typing the method signature "   public override void M" below, code completion should give you the ones you can override starting with M

public class My2Test : MyTest {
   public override void M
}
Avatar of iangregson1
iangregson1

ASKER

Damb! yes thats what i thought, it wasn't working i think i need to reboot...

I wonder if i can ask 1 more thing... it is working but i just want to see if i am doing it the best way..

I have a class (not abstract but base) which another class inherits

There is some code in the base class in page_load that MUST be run no matter what

and then the derived class can implement/ovveride its own page_load

question is .... what is the program forgets to call base.Page_Load etc..

Is there some other way... maybe sealing a method on onload or something??

should i really be making virtual page_load rather than onLoad..

Any advice really appreciated

Thanks
you can
mark the page_load as final - so that this cannot be overridden
in page_load, do what you must do, then make a call to another function, say "on_page_load" which you make virtual

now descendant classes can interact with page load (override "on_page_load"), but still not escape the "must happen" code
its working now.. a reboot sorted it out.. and thanks for the comments on the page_load info.

Assigning points