Slide 1

Slide 1 text

Konstantinos Goutsos Undergraduate student – ECE Department StudentGuru Patras Member

Slide 2

Slide 2 text

Object-Oriented Programming

Slide 3

Slide 3 text

objects properties Object-Oriented Programming methods classes inheritance interfaces the basics

Slide 4

Slide 4 text

 Better approach to the real world  Modularity  Data Encapsulation  Code re-use  Pluggability and debugging Why use Object-Oriented Programming?

Slide 5

Slide 5 text

color manufacture date Car speed brake() changeGear() accelerate() our sample class gear

Slide 6

Slide 6 text

Car class implementation in C#

Slide 7

Slide 7 text

Visual C# 2012

Slide 8

Slide 8 text

automatic memory handling lots of libraries Why use Visual C# most code written for you desktop applications internet applications cross-platform object-oriented programming web+cloud services embedded systems

Slide 9

Slide 9 text

Variables types & declaration • Supported types: integers, doubles, strings, dates and many more • Declaration: [type] name = [value]; • Example: string name="Konstantinos"; • Important: Assign with one = compare with two == • Don‘t forget to initialize your variables!

Slide 10

Slide 10 text

• Declaration: [type][] name= {value, value, ….}; • For example: int[] numbers={0,1,2,3}; • Element reference: array[index]=5; • Memory is automatically allocated and cleaned Variables arrays

Slide 11

Slide 11 text

• Same logic as in mathematics: = 22 + 3 + 5 • Function declaration: [type] function_name ([type] arg1, [type] arg2,…) { statements; } Functions and methods the basics

Slide 12

Slide 12 text

Control statements if clauses • if (condition) statement1; else statement2; • if (condition1) statement1; else if (condition2) statement2; else statement3; Example int age; boolean legalAge; if (age>=18) legalAge=true; else legalAge=false;

Slide 13

Slide 13 text

switch (expression) { case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); break; default: Console.WriteLine("Default case"); break; } Control statements switch statement

Slide 14

Slide 14 text

for (int i = 1; i <= 5; i++) { Console.WriteLine(i); } int[] array={3,7,1,9}; foreach(int num in array){ Console.WriteLine(num); } Loop statements for and foreach

Slide 15

Slide 15 text

while (condition) { Console.WriteLine("StudentGuru rocks!!"); } int i=2012; do{ Console.WriteLine(i); } while (condition) Loop statements while and do

Slide 16

Slide 16 text

• .NET Framework 4.5 support • Simpler asynchronous/threaded programming with the async and await keywords • Quicker debugging with Caller Information • Windows Store application support What’s new in Visual C# 2012

Slide 17

Slide 17 text

Visual Studio 2012

Slide 18

Slide 18 text

• Support for Visual C#, Visual Basic, Visual F#, C, C++, ASP.NET, XNA • Complete development environment for major platforms including Windows desktop, Windows Store, Windows Phone, ΧΒox • Provides all the tools you might need to create pro-level applications Visual Studio

Slide 19

Slide 19 text

• Download the at: msdn.upatras.gr • Login with your department credentials: eceXXXX or ceidXXXX Get Visual Studio 2012 for free

Slide 20

Slide 20 text

• New look and feel including a dark theme (yay!) • Better faster IntelliSense • Support for .NET Framework 4.5 and Visual C# 2012 • Ability to develop for Windows Store and Windows Phone 8 • Blend for Visual Studio included Key new features

Slide 21

Slide 21 text

Web Browser Demo

Slide 22

Slide 22 text

• Microsoft Developer Network: msdn.microsoft.com • Visual C# in Visual Studio resources: http://bit.ly/OJFzDr • Active community at StackOverflow • StudentGuru: www.studentguru.gr • Contact us!! Visual C# Resources