Download presentation
Presentation is loading. Please wait.
1
1/50 Project Management
2
2/50 StumbleUpon
3
3/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
4
4/50 Why customize ArcGIS ? Workflow. Software does not do EXACTLY what you want to do “out-of-the-box” but has the programming infrastructure required that allows you to customize it to do exactly what you want
5
5/50 Extending ArcGIS, Add-ins, C#, & ArcObjects Adding toolbars, buttons, tools, etc. ArcGIS 10.1 provides tools for making Python Add-ins ArcGIS 10.0 did not (Free webinar)Free webinar ArcObjects SDK for the Microsoft.NET Framework will be covered in GIS Customization II ArcObjects is more comprehensive than Python
6
6/50 ArcEngine Build your own GIS-enabled app Does not require ArcGIS but does require ArcEngine runtime ($) Not covered in Customization courses
7
7/50 Open Source GIS components
8
8/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
9
9/50.NET Framework Overview CLS (Common Language Specification) C#, VB.NET, Managed C++, J# Framework Class Libraries CLR (Common Language Runtime) Windows OS Win32, IIS, MSMQ Compilers CIL (Common Intermediate Language) UI Web Form WinForm WPF Services WCF WorkFlow Data Access ADO.NET Entity Framwork LINQ to SQL Framework Base Classes & CTS (Common Type System) IO, Collections, Security, Threading, etc. CLS specifes rules.NET languages must follow to create.NET code that will reference the.NET Framework Class Libraries (.NET DLL Assemblies) and.NET CTS..NET compilers will compile.NET code into CIL stored in.NET assemblies (EXE or DLL).NET CLR will perform JIT (Just-In-Time compilation) to native machine code and ensure that the.NET assembly runs properly and securely.
10
10/50 System.Console.WriteLine() example mscorlib is required by CLR so no reference is required in code
11
11/50 Compiling and running The 4.0.NET Framework must be installed on the computer that will run a 4.0 Assembly (EXE) Use C# compiler to create hw.exe Running assembly invokes JIT by CLR and runs app
12
12/50 using keyword for Namespaces static keyword means you don’t need an instance of the class Program to call the function Main.
13
13/50 Class libraries, namespaces, classes Class Libraries are stored in a.NET assembly (DLL) Namespaces are a way of naming a group of related classes and other types. Namespaces can be nested. Namespace icon
14
14/50 Declaring and using variables Variable declaration syntax: [scope] [static] type name;
15
15/50 Variable Scope Variable declaration syntax: [scope] [static] type name;
16
16/50 16 of 29 Scope Review public internal (default) protected private Entire solution Assembly only Derived classes Class only More …
17
17/50 Types Variable declaration syntax: [scope] [static] type name; int long double bool etc. string array etc..NET Classes Classes you create.
18
18/50 Defining and calling functions Syntax for defining functions: [ scope] [static] return_type name ([params]) { // C# statements } 0 or more params are declared like variables and comma separated.
19
19/50 Scope
20
20/50 Command-line args for Console applications
21
21/50 C# Compiler & command-line args
22
22/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
23
23/50 Projects … … because any application worth building usually has more than one.cs file and other files (e.g. images, cursors, etc.)
24
24/50 Solutions … … because Projects must be part of a Solution Projects (.csproj) * Visual Studio Solution (.sln)
25
25/50 Folder structure for application development Download …
26
26/50 Creating an app dev folder - Move files up one level into src - Delete solution folder - Create a New Project … Blank Solution, in src - Save - Exit Visual Studio Solutions can include code from other CLS languages (e.g. VB.NET)
27
27/50 Adding a Project to a Solution
28
28/50
29
29/50
30
30/50 StartUp Project StartUp Project is the first project to run when the application is run Class Library Projects cannot be set as the StartUp Project
31
31/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
32
32/50 Presentation Layer Layered Applications Business Logic Layer Data Data Access Layer BLL Business objects & logic DAL Read/Write data from/to a database
33
33/50 Steps to building a layered application 1. Get requirements for application feature(s) 2. Decide on a presentation layer and sketch it out (no code) 3. Create the … Data access layer and tests, debug Business logic layer and tests, debug Presentation layer and connect to business layer, debug 4. Test the application 5. Create installer 6. Deploy application to users 7. Repeat until all application features are complete
34
34/50 Creating a Business Layer Add Class Library Project to Solution Suffix name with BLL (e.g. IssueTrackerBLL) Add classes to represent the business objects Add properties and methods to these classes to represent the business data and processes respectively
35
35/50 Testing a Business Layer Create a Test Project Common to have one Test Project per application Project Suffix Test Project name with “Tests”
36
36/50 Adding a Test
37
37/50 Editing the TestMethod
38
38/50 Running the test – no debugging With cursor in test method … Or right-click and use TestDriven.NET
39
39/50 Running the test – with debugging With cursor in test method … Or right-click and use TestDriven.NET Need Breakpoint (F9 to toggle)
40
40/50 Test results
41
41/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
42
42/50 Building a Presentation Layer (UI) Add UI Application Project that satisfies the requirements Windows Console Application Windows Forms Application WPF Application Web ASP.NET Web Application ASP.NET MVC Application Silverlight Application Suffix Project name with UI This is the StartUp Project
43
43/50 Windows Forms Application A Form is a container for UI controls Common for starting form to have name MainForm Drag & Drop from Toolbox
44
44/50 Naming child controls Give child control names prefixes btn = Button txt = TextBox lbl = Label lst = ListBox cbo = ComboBox rdo = RadioButton etc. Adding code to controls … Double-click control or code by hand
45
45/50 “Connecting” the UI and BLL Add Reference in UI to BLL Project Add using to UI code (MainForm.cs in this example)
46
46/50 Example: Accessing BLL from UI
47
47/50 Links for VS 2010 and C# “Quick Tour” of the VS 2010 IDE Beginner Developer Learning Centre Csharp-station.com tutorial
48
48/50 Keys to remember F1 – Context sensitive Help (If cursor is on keyword, help on keyword provided) F6 – Build code (compile) without running F5 – Build code (compile) and run F11 – Step through code, into called functions F10 – Step through code, not into called functions Shift-F5 – Stop running code F9 – Toggle Breakpoint at current statement
49
49/50 Overview Customize? Why, what, how?.NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications Business Logic Layer & Testing Presentation Layer (Windows Forms)
50
50/50
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.