what are mybase, myclass C#'s equivalents?
Printable View
what are mybase, myclass C#'s equivalents?
base()
this()
that i already did know what i really wanted to know was the myclass one..
Define what you mean by "myclass." Are you referring to the class itself? As the above user said, that would be this. ie; this.Close() (which would be Me.Close() in VB.NET). If you know what you mean by "myclass" but can't explain it, give us the VB.NET method or keyword of what you're referring to, and I'm sure we can come up with a C# equivalent.
the keyword is "MyClass" lol..
as MSDN says:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/vblr7/html/vakeyMyClass.htmQuote:
MyClass behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. Therefore, the method being called is not affected by overriding in a derived class. The following example compares Me and MyClass.
I looked through all the keywords for C# and didn't find anything that even remotely resembled that (I could of missed it though), except for base which is the equivalent of MyBase (which you already knew).
The only thing I can suggest for now is just declaring an object of the base class. Declaring an object of the derived class then calling MyClass sort of defeats the purpose of inheritance doesn't it?
Go to www.gotdotnet.com and ask in the forums there. If anyone would know what the equivalent is, it would be someone on those forums.
hmm ty its not that its something that i need, was just something i though about when reed a vb.net book
What an utterly useless keyword...