[RESOLVED] Invalid token in class?
I am currently trying to learn c# games programming.
i copied the following code from a book i have bought, and on the marked line it comes up with the error in the title of this thread. Any help as how to sort it?
c# code:
public class MainUiScreen : UiScreen, System.IDisposable
{
private Microsoft.DirectX.Direct3D.Texture buttonTextures = null;
private Microsoft.DirectX.Direct3D.Texture messageTexture = null;
private UiButton newButton = null;
private UiButton exitButton = null;
//events
public event System.EventHandler NewGame;
public event System.EventHandler Quit;
#region IDisposable Members
///<summary>
///clean up in case dispose isn't called
///</summary>
-MainUiScreen() \\it doesn't like the '-' on this line
{
Dispose();
}
///<summary>
///clean up any resources
///</summary>
...
if i remove the '-' it comes up with the error: no overload for method 'uiscreen' takes 0 arguments
please can someone help??
Thanks
GTJ
Re: Invalid token in class?
If you're trying to declare a destructor it is supposed start with a "~", not a "-". You should read about destructors.
http://msdn2.microsoft.com/en-us/library/66x5fx1b.aspx
Re: Invalid token in class?