Click here to Skip to main content
15,881,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 7:19
C-P-User-35-Nov-12 7:19 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 7:27
mvePete O'Hanlon5-Nov-12 7:27 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 7:48
C-P-User-35-Nov-12 7:48 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 8:16
C-P-User-35-Nov-12 8:16 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 8:30
mvePete O'Hanlon5-Nov-12 8:30 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 9:25
C-P-User-35-Nov-12 9:25 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 9:54
C-P-User-35-Nov-12 9:54 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 22:54
mvePete O'Hanlon5-Nov-12 22:54 
Ahhh. I think I see where you're having a problem. Each class there is in a separate namespace. In order to use a class from one namespace in another namespace, you need to make this visible in the class you are trying to use it in.

That's a quite confusing sentence, so a practical demo is in order here - there are two ways to see the class in a different namespace: the first way is to add a using statement before your class. So, in MainForm to see the SerialPortManager class, do this:
C#
using SerialPortListener.Serial;
namespace SerialPortListener
{
  public class MainForm : Form
  {
    private SerialPortManager portManager = new SerialPortManager();
    ....
  }
}
The other method to do this (in place of the using statement) is to fully qualify the classname by including the namespace in it like this:
C#
namespace SerialPortListener
{
  public class MainForm : Form
  {
    private SerialPortListener.Serial.SerialPortManager portManager = new SerialPortListener.Serial.SerialPortManager();
    ....
  }
}
If you are using Visual Studio and you have a class that is in a different unreferenced namespace, you should see a little blue square at the start of the class name (under the first letter). Either click this to bring up a menu or press Shift+Alt+F10; in both cases, it should let you choose whether to add the using statement or whether you want to fully qualify the class name.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:34
C-P-User-36-Nov-12 6:34 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 6:44
mvePete O'Hanlon6-Nov-12 6:44 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:57
C-P-User-36-Nov-12 6:57 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 7:59
mvePete O'Hanlon6-Nov-12 7:59 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:53
C-P-User-36-Nov-12 6:53 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 8:10
mvePete O'Hanlon6-Nov-12 8:10 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 9:37
C-P-User-36-Nov-12 9:37 
AnswerRe: 921600 Pin
Dave Kreskowiak1-Nov-12 5:11
mveDave Kreskowiak1-Nov-12 5:11 
GeneralRe: 921600 Pin
C-P-User-31-Nov-12 6:46
C-P-User-31-Nov-12 6:46 
GeneralRe: 921600 Pin
C-P-User-312-Nov-12 6:17
C-P-User-312-Nov-12 6:17 
QuestionThreads and semaphores Pin
C-P-User-331-Oct-12 7:11
C-P-User-331-Oct-12 7:11 
AnswerRe: Threads and semaphores Pin
Clifford Nelson31-Oct-12 8:02
Clifford Nelson31-Oct-12 8:02 
GeneralRe: Threads and semaphores Pin
C-P-User-32-Nov-12 6:27
C-P-User-32-Nov-12 6:27 
GeneralRe: Threads and semaphores Pin
Clifford Nelson2-Nov-12 6:44
Clifford Nelson2-Nov-12 6:44 
Questioncasting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:15
prasadbuddhika31-Oct-12 6:15 
AnswerRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:31
Simon_Whale31-Oct-12 6:31 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:34
prasadbuddhika31-Oct-12 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.