Akjell
Akjell

Reputation: 109

Visual Studio doesn't recognize functions in my class

I'm using Visual Studio 2010 to write C# code. I've added a reference to a class to my Window application solution named BotSuit.

In my code I added:

using BotSuite;

When I want to use the functions in my class, BotSuite, I need to type this for it to work.

ListGold = BotSuite.ImageLibrary.Template.AllImages(source, refpic, 24);

Why can't I just type this?

ListGold = AllImages(source, refpic, 24);

Upvotes: 0

Views: 1671

Answers (2)

PiotrWolkowski
PiotrWolkowski

Reputation: 8792

In C# your classes exists in namespaces. You can think of it as of a directory in which compiler can locate your code. If you want to use a class from one namespace in a class from another namespace you have to let the compiler know where to look for it. To do that use the using` keyword. It tells the compiler to include code from different namespaces.

Upvotes: 0

John S.
John S.

Reputation: 2007

Try adding a using statement to the top of your file:

using BotSuite.ImageLibrary.Template;

or

using BotSuite.ImageLibrary;

...

Template.AllImages(source, refpic, 24);

Upvotes: 3

Related Questions