Namespaces Group related C# features into categories

Slides:



Advertisements
Similar presentations
Intel Parallel Advisor Workflow David Valentine Computer Science Slippery Rock University.
Advertisements

1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
Introduction to the C# Programming Language for the VB Programmer.
Distributed Systems Tutorial 1 - Getting Started with Visual C#.NET.
Advanced Object-Oriented Programming Features
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
Intro to C# Dr. John P. Abraham UTPA. Background required Thorough C++ programming – If you made an A in 1370/1170 you will do fine with some effort.
Module 1: Introduction to C# Module 2: Variables and Data Types
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
.NET Framework & C#.
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Using Visual Studio 2013 An Integrated Development Environment (IDE)
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Namespaces Tonga Institute of Higher Education. Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output.
The First C# Program Elements of a C# Program. Exploring the First C# Program // Namespace Declaration using System; namespace HolaMundo { /// /// Summary.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
CS590VC – Tutorial 6 Client-side connection through external application.
How to write & use Perl Modules. What is a Module? A separate Namespace in a separate file with related functions/variables.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
First Venture into the Android World Chapter 1 Part 2.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
Intro to CS ACO 101 Lab Rat. Academic Integrity What does that mean in programming? Log into Blackboard and take the test titled “Applied Computing Course.
NUNIT Navaneeth Rajkumar Open Source Tools Team Project Central.Net.
Building Packages BCIS 3680 Enterprise Programming.
Packages are used in Java in-order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations.
Packages. The main feature of OOP is its ability to support the reuse of code: –Extending the classes –Extending interfaces The features in basic form.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Working with Packages BCIS 3680 Enterprise Programming.
WPF file relationships. Your Form The major files MainWindow.xaml MainWindow.xaml.cs namespace Listview1 public partial class App : Application
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
ActiveX DLL Create Class in Dll File & Client Application MCSD Doron Amir
Java Packages - allow you to group classes as a collection Standard Java library has packages: java.lang and java.util … Also hierarchical: java and javax.
1 Adding a Model. We have created an MVC web app project Added a controller class. Added a view class. Next we will add some classes for managing movies.
D OTNET ONLINE TRAINING. DOTNET Online Training Course Content : Introduction to.Net Online Training NET FUNDAMENTALS Why Dot Net? The Dot Net initiative.
Building C# Applications
C# Programming: From Problem Analysis to Program Design
INF230 Basics in C# Programming
Dependency Analysis Use Cases
OpenGL project setup.
Ch 10- Advanced Object-Oriented Programming Features
Advanced Object-Oriented Programming Features
Programming with ANSI C ++
Introduction to .NET Framework Ch2 – Deitel’s Book
CE-105 Spring 2007 Engr. Faisal ur Rehman
Dependency Analysis Use Cases
Java Basics Packages.
Module 1: Getting Started
MIS Professor Sandvig MIS 324 Professor Sandvig
Introduction to C# AKEEL AHMED.
CSCI 3328 Object Oriented Programming in C# Chapter 1: Introduction to C# UTPA – Fall 2012 This set of slides is revised from lecture slides of Prof.
Social Media And Global Computing Introduction to Visual Studio
Understanding the Visual IDE
Visual Studio 2005 Options for Release Mode: C++, Fortran, Linker
1. Open Visual Studio 2008.
ms vısual studıo 2008-Introductıon TUTORIAL
Social Media And Global Computing Using DLLs with MVC
Social Media And Global Computing Creating DLLs with Visual Studio
Tonga Institute of Higher Education
MIS Professor Sandvig MIS 324 Professor Sandvig
Entity Framework Code-First Migrations
Web programming and advanced development techniques
Algorithms File Systems Lab Environment.
NAMESPACE.
IS 135 Business Programming
Modern Collections Classes & Generics
Presentation transcript:

Namespaces Group related C# features into categories Contain code that can be reused .NET framework library (FCL) contains many namespaces Must be referenced with using directive in order to be used Example: Console feature is in namespace System

C# namespaces- allow you to group classes as a collection  Standard C# .NET Framework library has namespaces: System and System.Linq … Also hierarchical: System.Collections.Generic WHY? Guarantee uniqueness of class names NOTE: no logical relationship between namespaces … just physical

USING namespaces Can use all classes within namespace and all public classes in other classes as long as you 1. Qualify System.Collections.ArrayList 2. using namespace using System.Collections; 3. using a class in a namespace using MyNameSpace.MyClass;

careful with name conflicts EXAMPLE using System.DateTime; using System.Net.HttpRequestHeader; //both have Date class SOLNs: using System.DateTime.Date; to use this one use qualifiers if you need both.

HOW TO ADD A CLASS TO A namespace Create a new project of type Class Library Add code defining public class MyNameSpace { class MyClass{} } Compile to create a .dll file

HOW TO ADD A CLASS TO A namespace In project using class: Add a reference to the class library in an app Right click on project in solution explorer and select Add Reference In code using class Specify a using directive using MyNameSpace;

Directory structure Put source files of namespace in subdirectory of project directory . (projectdirectory) ManipCN.java MyNumericsNameSpace ComplexNumber.cs Build in project directory

TO SHARE namespaces Need to have special directory. I called mine C:\Csharp\classes NOTE: Csharp is my BASE directory I put files ComplexNumber.java in C:\Csharp\classes\ I put ManipCN.cs in C:\Csharp