Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Windows Programming

October 2016
Course Info

• Title: Windows Programming


• Code: CoSc4152
• Credit: 3 / 5 ECTS
• Delivery: Lecture + Lab

11/30/2018 Windows Programming 2


Course Content
• .NET framework introduction
– What is the .NET Framework?
– What’s in the .NET Framework?
– Writing Applications Using the .NET Framework
– C#?
• C# fundamentals
– Namespaces, data types, operators, value and
reference types, constructors, flow control, arrays
and strings ...

11/30/2018 Windows Programming 3


Course Content
• Object-Oriented Programming with C#
– Defining classes, Inheritance, polymorphism,
interfaces, exception handling, interacting with the
Garbage collector, indexers, collections, enumerations
...
• Basic Window Forms
– Controls, The Button Control, The Label and LinkLabel
Controls, The TextBox Control, The RadioButton and
CheckBox Controls, The RichTextBox Control, The
ListBox and CheckedListBox Controls, The ListView
Control, The TabControl Control, ...

11/30/2018 Windows Programming 4


Course Content
• Advanced Window Forms
– Menus and Toolbars, Toolbars, SDI and MDI
Applications, Building MDI Applications, Creating
Controls ...
• Data Access
– File System Data, Introduction to LINQ, Applying
LINQ

11/30/2018 Windows Programming 5


Evaluation

• Group Assignment [20%]


• Two Tests [30%]
• Lab Exercises [10%]
• Final Exam [40%]

11/30/2018 Windows Programming 6


References
• Erik Brown, Windows Forms in Action - Second
Edition
• Rod A. Smith et al, C# Programming
• Christian Nagel, Jay Glynn, Morgan Skinner,
Professional C# 5.0 and .NET 4.5.1, Wrox
Press, 2014.

11/30/2018 Windows Programming 7


The .NET Framework
Topics

• What is the .NET Framework?


• What’s in the .NET Framework?
• Writing Applications Using the .NET
Framework

11/30/2018 Windows Programming 9


.NET Framework?

• a platform for developing applications


• Microsoft release, runs on Windows
• alternative versions for other systems
– Mono, open-source version of .NET Framework
• compact framework, PDAs/ smart-phones

11/30/2018 Windows Programming 10


.NET Framework?
• no restriction on the type of applications
– Windows applications
– Web applications, multiplatform applications
– Web services …
• designed to be used from any language
• languages can also communicate with each
other

11/30/2018 Windows Programming 11


What’s in the .NET Framework?

• library of code
– categorized into modules
– defines some basic types, Common Type System (CTS)
• facilitates interoperability between languages
• Common Language Runtime (CLR)
– maintaining the execution of all applications
developed using the .NET library

11/30/2018 Windows Programming 12


Writing Applications Using
the .NET Framework
• using the .NET code library
• environments
– VS, VCE
• compilation is a two step process
– CIL
– target code

Any similarity with JAVA?

11/30/2018 Windows Programming 13


code.v
Assemblies code.v
bcode.cs
b

• CIL is stored in assembly


Compiler
• includes:
.EXE / .DLL
– executable files
– libraries assembly

– metadata
• enables assemblies to be fully self descriptive
– optional resources

11/30/2018 Windows Programming 14


Assemblies
• place reusable code in a place accessible to all
applications
– global assembly cache (GAC)
• How does CLR find assemblies?
– FCL assemblies reside in GAC
– CLR looks in GAC first, then EXE's directory…

11/30/2018 Windows Programming 15


Managed Code
• Code written using .NET Framework is
managed when executed
• CLR looks after applications by
– managing memory
– handling security
– allowing cross-language debugging …
• applications not run under the control of CLR,
unmanaged

11/30/2018 Windows Programming 16


Garbage Collection

• .NET method of making sure that the memory


used by an application is freed up
• Prior to .NET, responsibility of programmers
– few errors, memory disappears, …
• works by periodically inspecting the memory
of your computer

11/30/2018 Windows Programming 17


Linking

• code that compiles into CIL needn’t be


contained in a single file
• compiled together into a single assembly

• Reason for splitting code?

11/30/2018 Windows Programming 18


Summary
• Clients need CLR & FCL to run .NET apps
• Design trade-off…
+ managed execution (memory protection, etc.)
+ portability:
– slower execution?

11/30/2018 Windows Programming 19


Summary
• Cross-platform execution [FCL, CLR]
.DLL
.EXE .DLL
.DLL

OS Process

other FCL
JIT Compiler
assemblies

obj code Core FCL


obj code
obj code assembly
Native code

CLR

Underlying OS and HW
11/30/2018 Windows Programming 20
Summary
C++

Non .NET Application

C++ Compiler

Assembly (.dll/ .exe) – Native

Operating System
11/30/2018 Windows Programming 21
C# VB6 C++ J# Other

.NET Application

Respective Language Compiler

Assembly - CIL

CIL
C
L JIT Compiler
R Native Code

Operating System
11/30/2018 Windows Programming 22
C# Fundamentals

NEXT:02_c#_fundamentals.pptx

11/30/2018 Windows Programming 23

You might also like