SlideShare uma empresa Scribd logo
1 de 19
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

Mais conteúdo relacionado

Mais procurados

Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
smumbahelp
 
structure and union
structure and unionstructure and union
structure and union
student
 

Mais procurados (20)

Python functions part10
Python functions  part10Python functions  part10
Python functions part10
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
2 programming with c# i
2 programming with c# i2 programming with c# i
2 programming with c# i
 
Structure c
Structure cStructure c
Structure c
 
Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
 
pointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpppointers, virtual functions and polymorphisms in c++ || in cpp
pointers, virtual functions and polymorphisms in c++ || in cpp
 
Structure in c sharp
Structure in c sharpStructure in c sharp
Structure in c sharp
 
Structure & Union in C++
Structure & Union in C++Structure & Union in C++
Structure & Union in C++
 
structure and union
structure and unionstructure and union
structure and union
 
Constructor and Destructor in c++
Constructor  and Destructor in c++Constructor  and Destructor in c++
Constructor and Destructor in c++
 
Next Generation of Javascript
Next Generation of JavascriptNext Generation of Javascript
Next Generation of Javascript
 
Pointers in C
Pointers in CPointers in C
Pointers in C
 
Pointers - DataStructures
Pointers - DataStructuresPointers - DataStructures
Pointers - DataStructures
 
Constructor & Destructor
Constructor & DestructorConstructor & Destructor
Constructor & Destructor
 
Dynamic Memory Allocation in C
Dynamic Memory Allocation in CDynamic Memory Allocation in C
Dynamic Memory Allocation in C
 
Basic c#
Basic c#Basic c#
Basic c#
 
Pointers
 Pointers Pointers
Pointers
 
C Programming - Refresher - Part II
C Programming - Refresher - Part II C Programming - Refresher - Part II
C Programming - Refresher - Part II
 
Presentation on pointer.
Presentation on pointer.Presentation on pointer.
Presentation on pointer.
 
Pointers
PointersPointers
Pointers
 

Destaque

Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...
Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...
Integrating Drupal and Native Applications: The Story of the Elle Decor LookB...
Acquia
 
Q4 2013 jnpr financial results slides 1 23 14
Q4 2013 jnpr financial results slides   1 23 14Q4 2013 jnpr financial results slides   1 23 14
Q4 2013 jnpr financial results slides 1 23 14
IRJuniperNetworks
 
Coastal Georgia Academy: Transition to General Education
Coastal Georgia Academy: Transition to General EducationCoastal Georgia Academy: Transition to General Education
Coastal Georgia Academy: Transition to General Education
eeniarrol
 

Destaque (20)

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

Semelhante a New Features in .Net Framework 4.0 By Nyros Developer

Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
LiquidHub
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5th
Connex
 

Semelhante a New Features in .Net Framework 4.0 By Nyros Developer (20)

Virtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptVirtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.ppt
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Code Documentation. That ugly thing...
Code Documentation. That ugly thing...Code Documentation. That ugly thing...
Code Documentation. That ugly thing...
 
Abstraction
Abstraction Abstraction
Abstraction
 
Abstraction
AbstractionAbstraction
Abstraction
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5th
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
Clean code
Clean codeClean code
Clean code
 
Clean code slide
Clean code slideClean code slide
Clean code slide
 
C++_notes.pdf
C++_notes.pdfC++_notes.pdf
C++_notes.pdf
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
Writing code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongWriting code that writes code - Nguyen Luong
Writing code that writes code - Nguyen Luong
 
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen LuongTechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
C#ppt
C#pptC#ppt
C#ppt
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer Melayi
 
C# 7 development
C# 7 developmentC# 7 development
C# 7 development
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
csharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptxcsharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptx
 

Mais de Nyros Technologies

Mais de Nyros Technologies (20)

MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
 
Web Designing Bugs - Fixes By Nyros Developer
Web Designing Bugs - Fixes By Nyros DeveloperWeb Designing Bugs - Fixes By Nyros Developer
Web Designing Bugs - Fixes By Nyros Developer
 
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros DeveloperCapistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros Developer
 
Web 2.0 Design Standards By Nyros Developer
Web 2.0 Design Standards By Nyros DeveloperWeb 2.0 Design Standards By Nyros Developer
Web 2.0 Design Standards By Nyros Developer
 
Web 2.0 By Nyros Developer
Web 2.0 By Nyros DeveloperWeb 2.0 By Nyros Developer
Web 2.0 By Nyros Developer
 
Language Integrated Query By Nyros Developer
Language Integrated Query By Nyros DeveloperLanguage Integrated Query By Nyros Developer
Language Integrated Query By Nyros Developer
 
Oops in PHP By Nyros Developer
Oops in PHP By Nyros DeveloperOops in PHP By Nyros Developer
Oops in PHP By Nyros Developer
 
Connect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros DeveloperConnect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros Developer
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Research on Audio and Video Streaming
Research on Audio and Video StreamingResearch on Audio and Video Streaming
Research on Audio and Video Streaming
 
User Interface
User InterfaceUser Interface
User Interface
 
Audio and Video Streaming
Audio and Video StreamingAudio and Video Streaming
Audio and Video Streaming
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
Social Networking
Social NetworkingSocial Networking
Social Networking
 
Payment Gateway
Payment GatewayPayment Gateway
Payment Gateway
 
Aws
AwsAws
Aws
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Test Drive Development in Ruby On Rails
Test Drive Development in Ruby On RailsTest Drive Development in Ruby On Rails
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