LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2013, 08:41 PM   #1
tw1tch
LQ Newbie
 
Registered: Sep 2012
Distribution: Windows 7, Ubuntu 12.10, Fedora 17
Posts: 27

Rep: Reputation: Disabled
The type or namespace 'QuitEventArgs' could not be found.


Hi ive been following this tutorial:http://tuxradar.com/beginnerscode
on using mono and ive encountered this error in my progress heres the area where I think the problem lies since the error message reads:

"The type or namespace name 'QuitEventArgs' could not be found. Are you missing a using directive or an assembly reference?"

and here is the code:

Code:
using System;

namespace TroutWars
{
	public class TroutWars
	{
		public TroutWars() {
				Video.SetVideoMode(1024, 768);
				Events.Quit += new EventHandler<QuitEventArgs>(Quit);
				Events.Run();
}
void Quit(object sender, QuitEventArgs e) { 
        Events.QuitApplication(); 
}
	}
}
If its helpful here is the code for the main.cs:
Code:
using SdlDotNet;
using SdlDotNet.Core;
using SdlDot.Graphics;
using System;
using System.Drawing;

namespace TroutWars
{
	class MainClass
	{
public static void Main (string[] args)
		{
				TroutWars game = new TroutWars(); 
} 
                 
                 
}
	}
and ive attached an image of the code
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2013-01-17 21:32:09.png
Views:	19
Size:	179.7 KB
ID:	11635  
 
Old 01-19-2013, 08:25 PM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Apply the use of the "using" directive where needed (as opposed to where not needed).

There's nothing in the file (that you have posted) with the MainClass that requires the following:
Code:
using SdlDotNet;
using SdlDotNet.Core;
using SdlDot.Graphics;
using System;
using System.Drawing;
However, within the file that you define TroutWars, you might find it helpful to put those "using" directives at the beginning of the file.

As for QuitEventArgs, it is part of the SdlDotNet.Core namespace.

P.S. Who knows... I could be wrong... I'm not a C# developer.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dovecot autocreate plugin - no namespace found GDarkBladE Linux - Server 1 05-25-2011 04:32 PM
Host found but no data record of requested type gokiwiinternet Linux - Software 3 08-29-2006 07:38 AM
No devices of the appropriate type were found on the driver disk macarthor Red Hat 4 08-11-2006 02:32 PM
No LAN type found in network configuration on redhat 9.0 ejain Linux - Networking 3 05-11-2005 09:30 AM
LAN type not found in network configuration ejain Linux - Hardware 1 04-01-2005 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration