1 / 54

Developing Windows and Web Applications using Visual Studio.NET

Developing Windows and Web Applications using Visual Studio.NET. Drew Robson. Agenda. About SSW and Presenters Student Introduction Course Overview .NET Overview OOP VB.Net vs C# VS. Net Overview/ Demo Hands on lab. About SSW.

waldemar
Download Presentation

Developing Windows and Web Applications using Visual Studio.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developing Windows and Web Applications using Visual Studio.NET Drew Robson

  2. Agenda About SSWand Presenters Student Introduction Course Overview .NET Overview OOP VB.Netvs C# VS. Net Overview/ Demo Hands on lab

  3. About SSW • SSW Consulting has 18 years development / consulting experience. • Adam Cogan is the Chief Software Architect at SSW • 1of 3 Microsoft Regional Directors in Australia

  4. Drew Robson • Senior Software Architect @ SSW • Loves C# and .NET • Specializes in • Windows Forms • ASP.NET • ASP.NET MVC • TFS

  5. How to log on

  6. Admin Stuff • Attendance • Please initial the sheet next to your name • Hands On Lab • Homework • Certificate • At end of 10 sessions

  7. Introductions • Name • Company • Experience • IT • Programming • .NET • C# / VB • Database • Goals for the course Anything else after 9PM

  8. Session 1: Overview This session will cover • What is .NET? • Language Differences VB + C# • Review of OOP • N-Tier Solution Design • Demo: Creating WinForms

  9. What is .NET? .NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software Microsoft, beginning 2000

  10. What is .NET? • An application development platform from Microsoft • Runtime (Virtual machine) • Tools • Languages, IDE, … • Rapidly develop secure and robust software • Web and Windows • Full support for object-oriented programming

  11. Compiles to MSIL Represents codeindependent from src Executes MSIL

  12. What is .NET? • Language Independence • VB • C# • F# • C++ • IronPython • Any language that supports the Common Language Runtime (CLR) Specification

  13. Tools • C:\Windows\Microsoft.NET

  14. History of .NET and Visual Studio • 2002 - .Net 1.0 / Visual Studio.NET • 2003 - .Net 1.1 / Visual Studio 2003 • 2005 - .Net 2.0 / Visual Studio 2005 • 2007 - .Net 3.5 / Visual Studio 2008 • 2008 - .Net 3.5sp1 (added EDMX) • 2010 - .Net 4.0 / Visual Studio 2010 • 2012 - .Net 4.5 / Visual Studio 2012

  15. What is the .NET Framework? • Over 4500 classes that provides features such as: • Data access and connectivity (ADO.NET) • User Interfaces (WinForms, WPF) • Web Applications (ASP.NET, Silverlight) • Network Communication (WCF) • Workflow (WF)

  16. .NET Framework • Evolution • The whole .NET FX 3.5 • Further improvements in .NET 4 • Win8 devices, parallel computing,HTML5 in .NET 4.5

  17. CLR =Common Language Runtime • Allows for language independence • Memory Management (allocation and de-allocation of memory) • Performs automatic garbage collection with the elimination of pointers • No more memory leaks (in theory at least!) • Exception Handling • Security (sandbox from the OS– cannot run malicious code) • Converts the IL byte code into runtime code

  18. C# ? • Main programming language for .NET framework • Based on C • Built with hindsight • Java Very similar to Java • C++ Very similar to C++ • A ‘modern language’ that did not inherit the ‘junk’ from C++ (eg header files, syntax)

  19. C# Basis • Variable declaration bool isVeryLong; • Variable assignment isVeryLong = false; • Control statements if (yourInput.Length > 10) { isVeryLong = true; }

  20. History C# - Anders Hejlsberg • C# 1.0 – first Version • C# 2.0 – Everything that didn’t fit in 1.0 • C# 3.0 – LINQ, functional influence • C# 4.0 – Dynamic Programming • C# 4.5 – Devices and Web • C# 5.0 …?

  21. OOP

  22. Terms - I want you to know • Classes • Objects • Properties • Methods • Events #1 Inheritance #2 Encapsulation #3 Polymorphism #4 Abstraction

  23. Class vs Object Class • Defines abstract characterizations of a “thing” • Customer • Employee • Car • Blueprint or template • Object • Instance of a class • “Car” has an instance called “petersCar”

  24. Terms • Properties • Changeable features of objects • Eg. „Color“ of a car • Methods • Actions on an object • Eg. Car has a method „Accelerate“ • Events • Let other objects know about an action • Eg. Car has an event „DoorOpened“

  25. #1 Inheritance • A "square" is a "shape"

  26. A "shape" defines a common property "Color" • A "square" inherits the property "Color"

  27. #2 Encapsulation • Information hiding • E.g.A shape hides internal data • 1st point • 2nd point

  28. A „Square" has internal fields like „_side“

  29. #3 Polymorphism • Appear as another • Be used like another

  30. #3 Polymorphism var shapes = new List<IShapes>() { new Square(“Red"), new Rectangle(“Blue"), new Triangle(“Red") }; foreach (var shape in shapes) { Console.WriteLine(shape.Color + ": " + shape.CalcSize()); }

  31. #4 Abstraction • Allows inheritance but no instantiation

  32. No instance of a "Shape"

  33. VB.NET versus C#

  34. Language Differences Variables ' VB.NET DimFavouriteColourAsString = "LightGreen" // C# StringFavouriteColour = "LightGreen";

  35. Language Differences Methods 'VB.NET Public Function GetName () As String Public Sub DoSomething() //C# public string GetName() {} public void DoSomething() {}

  36. Language Differences Events and Methods

  37. Language Differences VB.NET Properties PublicPropertyFirstName() AsString Get ReturnpFirstName EndGet Set(ByVal value AsString) pFirstName = value EndSet EndProperty

  38. Language Differences C# Properties private string firstName; public StringFirstName{ get { returnfirstName } set { firstName= value; } }

  39. Properties since C# 3.0 Automatic Properties Feature public StringFirstName{ get; set;} Notice no internal variable was declared?  It is created by the compiler Saves typing and makes code neater

  40. .NET 3.5 • Auto Implemented Properties • Collection Initializers (limited) • Named parameters • Optional parameters • Lambdas (limited) • Can span statements across multiple lines • Auto Implemented Properties • Collection Initializers • Named parameters • Optional parameters • Lambdas • Can span statements across multiple lines

  41. .NET 4 • Auto Implemented Properties • Collection Initializers • Named parameters • Optional parameters • Lambdas • Can span statements across multiple lines • Auto Implemented Properties • Collection Initializers • Named parameters • Optional parameters • Lambdas • Can span statements across multiple lines

  42. Visual Studio 2010

  43. Visual Studio 2010

  44. Windows Forms

  45. What is a Form? • A UI Component • WinForm – a Window displayed by an application • Web Forms are page hosted in a browser

  46. Controls • Textboxes • Buttons • Tool Strip Menu • Picture • Labels

  47. User Controls • Reuse a set of controls • e.g. Form with • Billing Address and • Shipping Address Where an address consists of • Address line 1 • Address line 2 • Suburb • State • Post code

  48. Events • Most controls have events • Examples • Clicked • TextChanged • Closing • Event Handlers • Can’t control the order the event gets handled

  49. Summary • The 10 Sessions • Overview of .NET • C#, and how it differs to VB.Net • OOP • Demo: Creating WinForms (C#)

  50. Hands ON LAB • Creating a Windows Form Application • Opening forms • Menus • Event handlers • User controls

More Related