SlideShare a Scribd company logo
WELCOME  TO ALL
New Features in .NET  Framework 4.0
* Visual Studio 2008 may be better than sliced bread, but the development team at Microsoft has already been working on the next release. * They have recently given us Visual Studio 2010 and the .NET Framework 4.0 as a Community Technology Preview (CTP); it boasts several features that would appeal to developers.
* This article will go into features that are the most relevant to .NET developers. * Please note that because this is a CTP, it doesn't mean that the final release will be exactly as you see in the CTP or as is described here.  * I can go over the features roughly as follows :
* Call Hierarchy of methods * A New Quick Search  * Implicit Line Continuations * The dynamic type   * Optional Parameters * Named and Optional Arguments
* In complicated solutions, a single method may be used from several different places, and attempting to follow how a particular method is being called can be difficult.  * In other words, you can look at what calls your method and what your method calls in a treeview format.
protected void Page_Load(object sender, EventArgs e) { BindDataControls() }   private void BindDataControls() { //DataBinding here }   protected void Button1_Click(object sender, EventArgs e) { BindDataControls(); }
* Now, if you wanted to figure out what calls BindDataControls(), you can right-click on it and choose "View Call Hierarchy.“ * This is a helpful visual cue for very complicated projects that we've all worked on at some point or another. * This gives you a window with a treeview format, as shown below :
 
A New Quick Search : * This isn't the same as the Search or Search and Replace window that searches for specific textual strings. * It's different in the sense that it searches across symbols (methods, properties, and class names) across your solution and filters them in the result view for you.
Example :
Implicit Line Continuations : * C# has had this for a long time—long lines of code can be split across several lines for more readability. * VB.NET has had it, but you've always had to add an underscore (_) at the end of each line, which could get a little annoying.  * Certain types of statements can now be split across several lines without the _ required.
Example : Dim breakfast = { New Crumpets With { .CrumpetAge = 221, .CrumpetSmell = "Foul" }, New Crumpets With { .CrumpetSmell = "good", .CrumpetAge = 1 } }
The dynamic type : * C# 4.0 introduces a new static type called dynamic. When you have an object of type dynamic you can “do things to it” that are resolved only at runtime: * dynamic d = GetDynamicObject(…); d.M(7);
* The C# compiler allows you to call a method with any name and any arguments on d because it is of type dynamic. *At runtime the actual object that d refers to will be examined to determine what it means to “call M with an int” on it.
Optional Parameters : *  A parameter is declared optional simply by providing  a default value for it: public void M(int x, int y = 5, int z = 7); * Here y and z are optional parameters and can be  omitted in calls: M(1, 2, 3); // ordinary call of M   M(1, 2); // omitting z – equivalent to M(1, 2, 7)   M(1); //omitting both y & z – equivalent to M(1, 5, 7)
Named and optional arguments : *  C# 4.0 does not permit you to omit arguments between commas as in M(1,,3). * This could lead to highly unreadable comma-counting code. Instead any argument can be passed by name. * Thus if you want to omit only y from a call of M you can write:
M(1, z: 3); // passing z by name Or M(x: 1, z: 3); // passing both x and z by name Or M(z: 3, x: 1); // reversing the order of arguments
Thank You

More Related Content

PPT
Structure in C
PPT
Structures
PPTX
Structures in c language
PPTX
When to use a structure vs classes in c++
PDF
Structures in c++
PDF
Types of pointer in C
PPTX
Pointers Refrences & dynamic memory allocation in C++
PPTX
Cs1123 12 structures
Structure in C
Structures
Structures in c language
When to use a structure vs classes in c++
Structures in c++
Types of pointer in C
Pointers Refrences & dynamic memory allocation in C++
Cs1123 12 structures

What's hot (20)

PPTX
Python functions part10
PPTX
Presentation on c structures
PPTX
2 programming with c# i
PPT
Structure c
DOCX
Bc0053 – vb.net & xml
PPT
pointers, virtual functions and polymorphisms in c++ || in cpp
DOCX
Structure in c sharp
PPTX
Structure & Union in C++
PPT
structure and union
PPTX
Constructor and Destructor in c++
PPTX
Next Generation of Javascript
PPTX
Pointers in C
PPT
Pointers - DataStructures
PPT
Constructor & Destructor
PPTX
Dynamic Memory Allocation in C
PPT
Basic c#
PPTX
PDF
C Programming - Refresher - Part II
PPTX
Presentation on pointer.
Python functions part10
Presentation on c structures
2 programming with c# i
Structure c
Bc0053 – vb.net & xml
pointers, virtual functions and polymorphisms in c++ || in cpp
Structure in c sharp
Structure & Union in C++
structure and union
Constructor and Destructor in c++
Next Generation of Javascript
Pointers in C
Pointers - DataStructures
Constructor & Destructor
Dynamic Memory Allocation in C
Basic c#
C Programming - Refresher - Part II
Presentation on pointer.
Ad

Viewers also liked (20)

PDF
CWT_AWARD
PDF
Memahami Bacaan Shalat
PPTX
January 5 (education)
PPTX
Kita Hebat
PDF
JBoye Presentation: WCM Trends for 2010
PPT
Caching By Nyros Developer
PDF
Codendi 4.0 User Guide
PDF
Tsaap-Notes – An Open Micro-Blogging Tool for Collaborative Notetaking during...
PDF
Bonjour French Film Festival - Runner Up Young Spikes Indonesia 2013
PPTX
Anti immigration laws
PPT
Digital Marketing
PPT
Transforming Xml Data Into Html
PDF
emediaIT - Mobility Solutions - 2011.03.01
PPTX
Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...
PDF
Q4 2013 jnpr financial results slides 1 23 14
KEY
ApacheCon 2011
PPT
Coastal Georgia Academy: Transition to General Education
PDF
The Year Book PR.ONE
PPTX
Perrilaku terpuji
PPTX
Multimedia kajian tempatan
CWT_AWARD
Memahami Bacaan Shalat
January 5 (education)
Kita Hebat
JBoye Presentation: WCM Trends for 2010
Caching By Nyros Developer
Codendi 4.0 User Guide
Tsaap-Notes – An Open Micro-Blogging Tool for Collaborative Notetaking during...
Bonjour French Film Festival - Runner Up Young Spikes Indonesia 2013
Anti immigration laws
Digital Marketing
Transforming Xml Data Into Html
emediaIT - Mobility Solutions - 2011.03.01
Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...
Q4 2013 jnpr financial results slides 1 23 14
ApacheCon 2011
Coastal Georgia Academy: Transition to General Education
The Year Book PR.ONE
Perrilaku terpuji
Multimedia kajian tempatan
Ad

Similar to New Features in .Net Framework 4.0 By Nyros Developer (20)

PDF
C++ Interview Questions and Answers PDF By ScholarHat
PPT
Virtual Function and Polymorphism.ppt
PDF
Dot Net Fundamentals
PPT
Code Documentation. That ugly thing...
PPTX
Abstraction
PPTX
PDF
Object Oriented Programming (OOP) using C++ - Lecture 1
PPTX
Presentation 5th
PDF
Object-oriented programming (OOP) with Complete understanding modules
PDF
Clean code
PPTX
Clean code slide
PDF
C++_notes.pdf
PPT
Oops lecture 1
PPSX
Writing code that writes code - Nguyen Luong
PPSX
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
DOCX
C# tutorial
PDF
Unit 2 Methods and Polymorphism-Object oriented programming
PPT
CSharp_03_ClassesStructs_and_introduction
PPTX
Object Oriented Programming with Object Orinted Concepts
PDF
IOC + Javascript
C++ Interview Questions and Answers PDF By ScholarHat
Virtual Function and Polymorphism.ppt
Dot Net Fundamentals
Code Documentation. That ugly thing...
Abstraction
Object Oriented Programming (OOP) using C++ - Lecture 1
Presentation 5th
Object-oriented programming (OOP) with Complete understanding modules
Clean code
Clean code slide
C++_notes.pdf
Oops lecture 1
Writing code that writes code - Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
C# tutorial
Unit 2 Methods and Polymorphism-Object oriented programming
CSharp_03_ClassesStructs_and_introduction
Object Oriented Programming with Object Orinted Concepts
IOC + Javascript

More from Nyros Technologies (20)

PPT
MVC Architecture in ASP.Net By Nyros Developer
PPT
Web Designing Bugs - Fixes By Nyros Developer
PPT
Capistrano Deployment By Nyros Developer
PPT
Silver Light By Nyros Developer
PPT
Web 2.0 Design Standards By Nyros Developer
PPT
Web 2.0 By Nyros Developer
PPT
Language Integrated Query By Nyros Developer
PPT
Oops in PHP By Nyros Developer
PPT
Connect with Facebook to Rails Application By Nyros Developer
PPT
Github By Nyros Developer
PPT
Research on Audio and Video Streaming
PPT
User Interface
PPT
Audio and Video Streaming
PPT
Deploying Rails Apps with Capistrano
PPT
Capistrano - Deployment Tool
PPT
Social Networking
PPT
Payment Gateway
PPT
GIT By Sivakrishna
PPT
Test Drive Development in Ruby On Rails
MVC Architecture in ASP.Net By Nyros Developer
Web Designing Bugs - Fixes By Nyros Developer
Capistrano Deployment By Nyros Developer
Silver Light By Nyros Developer
Web 2.0 Design Standards By Nyros Developer
Web 2.0 By Nyros Developer
Language Integrated Query By Nyros Developer
Oops in PHP By Nyros Developer
Connect with Facebook to Rails Application By Nyros Developer
Github By Nyros Developer
Research on Audio and Video Streaming
User Interface
Audio and Video Streaming
Deploying Rails Apps with Capistrano
Capistrano - Deployment Tool
Social Networking
Payment Gateway
GIT By Sivakrishna
Test Drive Development in Ruby On Rails

New Features in .Net Framework 4.0 By Nyros Developer

  • 2. New Features in .NET Framework 4.0
  • 3. * Visual Studio 2008 may be better than sliced bread, but the development team at Microsoft has already been working on the next release. * They have recently given us Visual Studio 2010 and the .NET Framework 4.0 as a Community Technology Preview (CTP); it boasts several features that would appeal to developers.
  • 4. * This article will go into features that are the most relevant to .NET developers. * Please note that because this is a CTP, it doesn't mean that the final release will be exactly as you see in the CTP or as is described here. * I can go over the features roughly as follows :
  • 5. * Call Hierarchy of methods * A New Quick Search * Implicit Line Continuations * The dynamic type * Optional Parameters * Named and Optional Arguments
  • 6. * In complicated solutions, a single method may be used from several different places, and attempting to follow how a particular method is being called can be difficult. * In other words, you can look at what calls your method and what your method calls in a treeview format.
  • 7. protected void Page_Load(object sender, EventArgs e) { BindDataControls() }   private void BindDataControls() { //DataBinding here }   protected void Button1_Click(object sender, EventArgs e) { BindDataControls(); }
  • 8. * Now, if you wanted to figure out what calls BindDataControls(), you can right-click on it and choose "View Call Hierarchy.“ * This is a helpful visual cue for very complicated projects that we've all worked on at some point or another. * This gives you a window with a treeview format, as shown below :
  • 9.  
  • 10. A New Quick Search : * This isn't the same as the Search or Search and Replace window that searches for specific textual strings. * It's different in the sense that it searches across symbols (methods, properties, and class names) across your solution and filters them in the result view for you.
  • 12. Implicit Line Continuations : * C# has had this for a long time—long lines of code can be split across several lines for more readability. * VB.NET has had it, but you've always had to add an underscore (_) at the end of each line, which could get a little annoying. * Certain types of statements can now be split across several lines without the _ required.
  • 13. Example : Dim breakfast = { New Crumpets With { .CrumpetAge = 221, .CrumpetSmell = "Foul" }, New Crumpets With { .CrumpetSmell = "good", .CrumpetAge = 1 } }
  • 14. The dynamic type : * C# 4.0 introduces a new static type called dynamic. When you have an object of type dynamic you can “do things to it” that are resolved only at runtime: * dynamic d = GetDynamicObject(…); d.M(7);
  • 15. * The C# compiler allows you to call a method with any name and any arguments on d because it is of type dynamic. *At runtime the actual object that d refers to will be examined to determine what it means to “call M with an int” on it.
  • 16. Optional Parameters : * A parameter is declared optional simply by providing a default value for it: public void M(int x, int y = 5, int z = 7); * Here y and z are optional parameters and can be omitted in calls: M(1, 2, 3); // ordinary call of M M(1, 2); // omitting z – equivalent to M(1, 2, 7) M(1); //omitting both y & z – equivalent to M(1, 5, 7)
  • 17. Named and optional arguments : * C# 4.0 does not permit you to omit arguments between commas as in M(1,,3). * This could lead to highly unreadable comma-counting code. Instead any argument can be passed by name. * Thus if you want to omit only y from a call of M you can write:
  • 18. M(1, z: 3); // passing z by name Or M(x: 1, z: 3); // passing both x and z by name Or M(z: 3, x: 1); // reversing the order of arguments