.NET 2.0 and Visual Studio 2005 SigWin 2004. Outline Language enhancements in C# Language enhancements in C# –Generics –Partial types –Anonymous methods.

Slides:



Advertisements
Similar presentations
Developer Knowledge Sharing Eric Sun Dec, What programming language did you learn in school and since then? Now, its time to refresh …
Advertisements

Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
1 Visual C# "Whidbey": Language Enhancements Anders Hejlsberg Distinguished Engineer Microsoft Corporation Anders Hejlsberg Distinguished.
Visual Basic 2005 By Sam Nasr November 6,
Generics Programming in C# Generics CSE 494R (proposed course for 459 Programming in C#) Prof. Roger Crawfis.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 12 th -13 th Lecture Pavel Ježek.
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
Visual Studio Extensibility, DSL Tools and T4 Code Generation Peter Goodman.
 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
Copyright © 2012 Pearson Education, Inc. Chapter 9 Delegates and Events.
.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
New Features in C# 2.0 Sergey Baidachni MCT, MCSD, MCDBA.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
LinqToSharePoint SandBoxed Solution Shakir Majeed Khan
Copyright © 2012 Pearson Education, Inc. Chapter 6 Modularizing Your Code with Methods.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
C# Event Processing Model Solving The Mystery. Agenda Introduction C# Event Processing Macro View Required Components Role of Each Component How To Create.
1 Documenting with Javadoc CS 3331 Fall 2009 How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
C# Classes and Inheritance CNS 3260 C#.NET Software Development.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
Eric Vogel Software Developer A.J. Boggs & Company.
Copyright © 2006 Thomas P. Skinner1 Chapter 5 Indexers, Interfaces, and Enumerators.
Animation and Double-Buffering. The animation methods described here are based on standard techniques of double-buffering applicable to most high-level.
Web Services Week 2 Aims: Getting started with creating simple C# applications within Visual Studio.NET Objectives: –An introduction to the syntax of C#.NET.
Introduction to C# C# is - elegant, type-safe, object oriented language enabling to build applications that run on the.NET framework - types of applications.
C# D1 CSC 298 Elements of C# code (part 2). C# D2 Writing a class (or a struct)  Similarly to Java or C++  Fields: to hold the class data  Methods:
Lecture 16: Multithreaded Programming. public partial class Form1 : Form { Thread ct; Thread rt; public static int circle_sleep = 0; public static int.
Sample Application Multi Layered Architecture (n-tier): –Graphical User Interface (GUI): Forms, components, controls The Visual Designer in Visual Studio.
Session 08 Module 14: Generics and Iterator Module 15: Anonymous & partial class & Nullable type.
1 Chapter Eleven Handling Events. 2 Objectives Learn about delegates How to create composed delegates How to handle events How to use the built-in EventHandler.
Jon Shemitz Complicated stuff, quickly..NET 2.0. ● Generics50% & Nullable Types ● Iterators 10% ● Delegate Enhancements35% ● Partial Types5%
Getting Started with C# August 29, NET Concepts Language Independence Language Integration  your C# program can use a class written in VB Program.
Modern Software Development Using C#.NET Chapter 5: More Advanced Class Construction.
Hoang Anh Viet Hà Nội University of Technology Chapter 1. Introduction to C# Programming.
Dynamic Dropdown Lists 1. Objectives You will be able to Use Dropdown Lists to solicit multiple choice user input in an ASPX web page. Populate a Dropdown.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Type your question here. Type Answer Type your question here. Type Answer.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
C# Introduction Part 1. Which Visual Studio Should I use? Any Express (2012, 2013…) or Community Edition 2013 Any full version.
Advanced C# Types Tom Roeder CS fa. From last time out parameters difference is that the callee is required to assign it before returning not the.
Bill Campbell, UMB Microsoft's.NET C# and The Common Language Runtime.
Objects and Classes Continued Engineering 1D04, Teaching Session 10.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 10 th Lecture Pavel Ježek
Neal Stublen Tonight’s Agenda  Indexers  Delegates and events  Operator overloading  Class inheritance  Q&A.
Introduction to C# 2.0 An Advanced Look Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
Session 07 Module 13 - Collections. Collections / Session 7 / 2 of 32 Review  A delegate in C# is used to refer to a method in a safe manner.  To invoke.
1 Documenting with Javadoc CS 3331 Section and Appendix B of [Jia03] How to Write Doc Comments for the Javadoc TM Tool available from
Satisfy Your Technical Curiosity C# 3.0 Raj Pai Group Program Manager Microsoft Corporation
Lecture 10: Generics & Basic Desktop Programming Svetla Boytcheva AUBG, Spring COS 240 Object-Oriented Languages.
Architecture Multi Layered Architecture (n-tier): Application: Model Controllers Database Access Graphical User Interface (GUI): Forms, components, controls.
Other news? async and await Anonymous types (var, dynamic) Tuples Object instantiation Extension methods UCN Teknologi/act2learn1FEN 2014.
Module 1 Introducing C# and the.NET Framework. Module Overview Introduction to the.NET Framework 4 Creating Projects Within Visual Studio 2010 Writing.
Writing Better C# Using C# 6 By: Mitchel Sellers.
1 Working with Controls at Run Time. 2 Objectives You will be able to Add controls to a Windows form at run time. Modify controls at run time.
Classes Classes are a major feature of C++. They support – – Abstraction – Data hiding – Encapsulation – Modularity – Re-use through inheritance.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
C# Present and Future Marita Paletsou Software Engineer.
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T DEV315: Visual C# Under the Covers An In-Depth Look at C# 2.0.
1 New Features in C# 2.0 Generic Types Iterators Simplified Delegates Anonymous Methods Partial Types Various © University of Linz, Institute for System.
MIS Professor Sandvig MIS 324 Professor Sandvig
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2005
Chapter 5: Programming with C#
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
Functions Used to write code only once Can use parameters.
Delegates & Events 1.
Creating Controls Dynamically in C#
Presentation transcript:

.NET 2.0 and Visual Studio 2005 SigWin 2004

Outline Language enhancements in C# Language enhancements in C# –Generics –Partial types –Anonymous methods –Nullable types IDE features IDE features –Intellisense –Refractoring –Code snippets –Other awesome stuff!

Generics Motivation Motivation

Generics One method: One method: public int AddSeconds(ArrayList myList) { int total=0; DateTime myDate; foreach (object myObj in myList) { myDate=(DateTime) myObj; total+=myDate.Second;} return total; }

Generics Other method is to derive your own collection class. Namespace is now cluttered with many strongly typed collections Other method is to derive your own collection class. Namespace is now cluttered with many strongly typed collections Answer to problem: GENERICS!!!!! Answer to problem: GENERICS!!!!!

Generics: Example System.Collections.Generic: System.Collections.Generic: private System.Collections.Generic.List myList; private Dictionary > myList;

Generics: old example public int AddSeconds(List myList) { int total = 0; foreach (DateTime myDate in myList) total += myDate.Second; return total; }

Partial types Easy way to separate automatically generated code from your own: Easy way to separate automatically generated code from your own: public partial class myClass {}

Anonymous methods Review of delegates Review of delegates Anonymous delegate=delegate without a function name, just code Anonymous delegate=delegate without a function name, just code

Anonymous method example: button1.Click += delegate { MessageBox.Show("Click"); }; Alternative: button1.Click+=new EventHandler(myButton1_Click); private void myButton1_Click(object sender, EventArgs e) { MessageBox.Show(“Click”); }

Nullable types Motivation Motivation Syntax: Syntax: int? myInt = null; if (myInt.HasValue) { //Do stuff here with myInt.Value } else { //It's null } int? d=1, f=null; Console.WriteLine(f ?? d);

Visual Studio 2005 IDE Demo! Demo!