new team member / new project for the team helps analyze relationships and structure understanding...

36

Upload: abigail-mills

Post on 31-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 2: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 3: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 4: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

•New team member / new project for the team

•Helps analyze relationships and structure

Understanding code

•Locates code in unfamiliar code bases•Understand call graphs

Navigating code

•Consume first development•Code generationWriting code

•Stepping behavior•Inspect object properties

Debugging code

Page 5: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 6: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 7: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

VS 2010 “Navigate To” Support

Page 8: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

View Call Hierarchy

VS 2010 introduces a new “View Call Hierarchy” feature that allows you to quickly discover where a particular method or property within your code-base is being called from

Page 9: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

View Call Hierarchy

Page 10: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 11: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 12: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Multiple Monitor Support:

Page 13: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Multiple Monitor Support:

Page 14: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Multiple Monitor Support:

Page 15: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Code Intellisense with VS 2008

Page 16: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Code Intellisense with VS 2010

Page 17: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

VS 2010’s Multi-Targeting Support

Microsoft has made some pretty major architectural changes with VS 2010 to enable much better and more accurate multi-targeting support.

They also updated the VS 2010 debugger, profiler and compilers to be able to target multiple versions of the CLR.

Page 18: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Moving a Project from .NET 2.0 to .NET 4.0

We can optionally retarget our project to work with a later version of .NET by right-clicking on the project within the solution explorer and by bringing up its properties dialog.  We can select the “target framework” dropdown within it and select the version of the .NET Framework we want to target:

Page 19: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

ASP.NET Version:

Page 20: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Share Point Integration in 2010

Visual Studio 2010 now includes built-in support for building SharePoint applications.  You can now Create,edit,build and debug SharePoint applications directly within Visual Studio 2010.  You can also now use SharePoint with TFS 2010.

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

•Snippets allow you to be more productive within source view.•Allowing you to create chunks of code with a minimum of character typing.•Visual Studio has supported the concept of “snippets” for VB and C# in previous releases – but not for HTML, ASP.NET markup and JavaScript.  With VS 2010 we now support snippets for these content types as well.

Page 21: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Snippet for loginView Control:

Page 22: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 23: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

C# 1.0

C# 2.0

C# 3.0

Managed Code

Generics

Language Integrated Query

C# 4.0Dynamic Programming

Page 24: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

C# 4.0 Language Innovations

Page 25: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Introduction

Since the inception of C#, each version bought some major changes and amendments in the language. For example, in C# 1.0, the major theme was Managed Code. Then in C# 2.0, Generics were introduced and lastly in C# 3.0 LINQ was introduced. C# 4.0 introduced the concept of Dynamic Programming in C#. Overall there are four main features that are introduced in the upcoming C# 4.0:

Dynamic Programming C# 4.0 supports Dynamic Programming by introducing new Dynamic Typed

Objects. The type of these objects is resolved at run-time instead of at compile-time.

Page 26: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

• A new keyword dynamic is introduced to declare dynamic typed object.

• The keyword tells the compiler that everything to do with the object, declared as dynamic, should be done dynamically at the run-time using Dynamic Language Runtime(DLR)

Before Dynamic Programming the code for reflection is like:

After Dynamic Programming Introduced in C# 4.0:

Page 27: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

From the above slide, you can call method(s) such as x.ToString(), y.ToLower(), z.Add(1), etc. and it will work smoothly. :) This feature is great and provides much flexibility for developers. Of course there are pros and cons of dynamic programming as well but where C# is going is something like having features of both static languages and dynamic languages.

Page 28: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Optional ParametersThe second feature is Optional Parameters. Let’s say I have a class Employee and I provide few overloads of the constructor to enable making certain parameters as optional as follows:

Page 29: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

With C# 4.0, you need to create just one constructor for that as follows:

As simple as that :) and you can easily call that as follows:

Named Argument:

we discussed an example of Employee class in which we passed some optional parameters in the constructor:

Page 30: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

And I can simply call that as shown below:

A question can be raised "Is there any way that we can skip qualification, i.e. third parameter and give the last parameter of middleName?"

"Yes absolutely, we can and that feature is called Named Argument in C# 4.0."

Page 31: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Optional “ref” modifier

object fileName = "Test.docx";object missing = System.Reflection.Missing.Value;

doc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

object fileName = "Test.docx";object missing = System.Reflection.Missing.Value;

doc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

doc.SaveAs("Test.docx");

Page 32: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Clean Web.Config Files

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we’ve added over the years, including the functionality for:

ASP.NET AJAX ASP.NET Dynamic Data ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC) ASP.NET Chart Control (which now ships built-into ASP.NET V4)

What this means is that when you create a new “Empty ASP.NET application” project in VS 2010, you’ll find that the new default application-level web.config file is now clean and simple:

Page 33: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Web.Config files in .Net 4

Page 34: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand

Auto-Start ASP.NET Applications

•Some web applications need to load large amounts of data, or perform expensive initialization processing

•Developers using ASP.NET today often do this work using the “Application_Start” event handler within the Global.asax file

•ASP.NET 4 ships with a new feature called “auto-start” that better addresses this scenario.

•You can do this by opening up the IIS 7.5 applicationHost.config file

(C:\Windows\System32\inetsrv\config\applicationHost.config)

Page 35: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand
Page 36: New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand