Click here to Skip to main content
15,886,036 members
Home / Discussions / C#
   

C#

 
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 
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 
What's probably confusing you is that the namespaces and class names are all very close. Let's simplify this with an easy example. Suppose we have a very simple vehicle creating system. I'm going to arbitrarily break this up like this:
C#
namespace WeMakeVehiclesForOthers
{
  public class BaseVehicle
  {
    protected void Buy() {}
  }
}
Now, in a namespace that we are going to call Cars, we are going to add a specific manufacturer:
using WeMakeVehiclesForOthers;
namespace Cars
{
  public class Ford : BaseVehicle
  {
    public void BuyCar()
    {
      Buy(); // We are calling Buy in the BaseVehicle class. Because we have inherited from this class
             // we don't have to do anything special here. As it's protected, we can access it here
             // but classes that don't derive from it can't call it directly.
    }
  }
}
Now finally, we have a set of car dealerships that want to sell custom Fords. They might look like this:
C#
using Cars;
namespace Dealers
{
  public class PetesDealers
  {
    private Ford ford = new Ford();
    public void BuyFord()
    {
      ford.BuyCar();
    }
  }
}
As you can see, you have full access to Ford and all the methods it has available. I hope this makes sense

*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 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 
GeneralRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:41
Simon_Whale31-Oct-12 6:41 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:48
prasadbuddhika31-Oct-12 6:48 
GeneralRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:48
Simon_Whale31-Oct-12 6:48 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika31-Oct-12 17:04
prasadbuddhika31-Oct-12 17:04 
GeneralRe: casting at runtime in c# Pin
Simon_Whale1-Nov-12 0:45
Simon_Whale1-Nov-12 0:45 
GeneralRe: casting at runtime in c# Pin
prasadbuddhika1-Nov-12 4:24
prasadbuddhika1-Nov-12 4:24 

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.