[Mono-list] Accessing one class from another

Paul paul at all-the-johnsons.co.uk
Fri May 2 10:33:00 EDT 2008


Hi,

I have an application which is causing me a small headache (too much
code, not enough rest syndrome!).

I have two files - mainform.cs which contains code for dealing with the
main winform. In the second file called xmlhander.cs, I have a class
called xmlhander.

In mainform.cs, I have a public class called Mainform. In this I have 

public Mainform()
{
  this.InitializeComponent();
  reset();
}

then code.

I can access everything defined in Mainform from other classes by just
creating a new instance of it. Easy enough. Mainform mf = new
Mainform();

In xmlhandler.cs, I have a public class called xmlhandler(). In this I
have

public xmlhandler() {}

However, if I try and create an instance of xmlhandler within Mainform
(same way : xmlhandler xml = new xmlhandler();), I get the following
error (from monodevelop - my other thread holds, I'm editing using emacs
and building via monodevelop)

Line 30 : The type or namespace name `xmlhandler' could not be found.
Are you missing a using directive of assembly reference? (CS0246)

All source is in the same namespace (marker).

Any help on this would be appreciated.

TTFN

Paul

-- 
Sie können mich aufreizen und wirklich heiß machen!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20080502/414ad34c/attachment.bin 


More information about the Mono-list mailing list