Vous êtes sur la page 1sur 44

Whats New with Visual Studio and C#?

Barbara Doyle
Jacksonville University
Game Plan
.NET Journey some nostalgia
Where are we now?
Recent announcements
Xamarin partnership
New Visual Studio enhancements
C# 6.0 language features
Future

2 2015 Cengage Learning Computing Conference


3 2015 Cengage Learning Computing Conference
.NET Framework
4.6

C# 6.0

4 2015 Cengage Learning Computing Conference


Recent Announcements
Visual Studio Community Edition
.NET Framework 4.6 to be shipped with VS 2015
Cross Platform Development
Xamarin Partnership

5 2015 Cengage Learning Computing Conference


6 2015 Cengage Learning Computing Conference
Recent Announcements
Open-source
CLR, Just-In-Time Compiler (JIT), Garbage Collector (GC),
and core .NET base class libraries
Several key components, like ASP.NET and the C#
compiler previously open sourced
.NET Compiler Platform (Roslyn) provides open
source C# and Visual Basic compilers with rich code
analysis APIs

7 2015 Cengage Learning Computing Conference


Recent Announcements

.NET Core Framework on Linux and OSX (Mac)

8 2015 Cengage Learning Computing Conference


Recent Announcements
.NET Core project is under the stewardship of
the .NET Foundation

Transferring source to GitHub

9 2015 Cengage Learning Computing Conference


GitHub
https://github.com/Microsoft/dotnet
Open Source Repository
10 2015 Cengage Learning Computing Conference
Xamarin Partnership

11 2015 Cengage Learning Computing Conference


Xamarin Partnership
Little Xamarin history
Sponsor Mono community
Xamarin already produces a cross-platform open
source .NET framework based on C#
Making it easier to add Xamarin tools to support
iOS and Android development alongside Windows
apps

12 2015 Cengage Learning Computing Conference


New Visual Studio Enhancements
No major chances to new editor
Menus now appear in Title Case style instead of all
capitals
Windows touch gestures now supported
New project type templates
Cross platform Development
Visual Studio Emulator for Android
Empty shared project template

13 2015 Cengage Learning Computing Conference


New Visual Studio Enhancements
Debugging Tools
New Breakpoint Settings Window
PerfTips (tooltips with performance information)
Few new code editor user interface editing tools
Window layouts
Quick action light bulb icon
Colorized tooltips
Simplified rename
Enhanced Peek Definition

14 2015 Cengage Learning Computing Conference


Touch Support Gestures Available
Scroll (tap-and-drag on the editor surface on the
regular and enhanced scrollbars)
Pinch-to-Zoom in/out
Select a whole line by tapping in the editor margin
Select words by double-tapping them
Invoke the editor context menu by pressing-and-
holding on words

15 2015 Cengage Learning Computing Conference


New Project Type Templates

Over 40
templates
with current
VS 2015 CTP
release +
Xamarin install

16 2015 Cengage Learning Computing Conference


New Breakpoint Settings Window
Two new icons appear with breakpoint

17 2015 Cengage Learning Computing Conference


New Breakpoint Settings Window
Settings opens Peek window

18 2015 Cengage Learning Computing Conference


PerfTips
Performance Information at-a-glance
Step over lines of code (F11) or run from
breakpoint to breakpoint debugger displays PerfTip

Clicking on time, displays Diagnostics Tools


windows revealing CPU and Memory usage
19 2015 Cengage Learning Computing Conference
New Code Editor User Interface Tools
No major improvements few changes
Configure and save window layouts
Quick action light bulb icon
Colorized tooltips
Simplified rename
Enhanced Peek Definition

20 2015 Cengage Learning Computing Conference


Configure and Save Windows Layouts

Windows App

21 2015 Cengage Learning Computing Conference Console App


Quick Action Light Bulb Icon
Streamlines Code

22 2015 Cengage Learning Computing Conference


Quick Action Light Bulb Icon

23 2015 Cengage Learning Computing Conference


Quick Action Light Bulb Icon
Provides preview of changes

24 2015 Cengage Learning Computing Conference


Quick Action Light Bulb Icon

Syntax Help
25 2015 Cengage Learning Computing Conference
Colorized Tooltips
Hover over collapsed code to pop up tooltip in color

26 2015 Cengage Learning Computing Conference


Colorized Tooltips
Keywords shown in blue within tooltip

Hover over methods to see its signature in color

27 2015 Cengage Learning Computing Conference


Simplified Rename

28 2015 Cengage Learning Computing Conference


Enhanced Peek Definition

Bring definition
of method or
class into file

29 2015 Cengage Learning Computing Conference


Enhanced Peek Definition
Peek released as part of Visual Studio 2013

30 2015 Cengage Learning Computing Conference


C# 6.0 Language Features
Current Language Specification C# 5.0
Released August 2012
No BIG new concepts with 6.0
Auto-properties can have initializers and no longer
require setters
Constructors can assign values to read-only
properties

31 2015 Cengage Learning Computing Conference


C# 6.0 Language Features
Many small features added
Using clauses for static classes bring static members
directly into scope
Exception can have filters
New string interpolation
Null conditional operator added

32 2015 Cengage Learning Computing Conference


Getter-only Auto-properties

33 2015 Cengage Learning Computing Conference


Auto-property Initializers

34 2015 Cengage Learning Computing Conference


Assignment to Read-only
Auto-properties in Constructors

35 2015 Cengage Learning Computing Conference


Static using Statements

Without using static directive,


would write
Console.Clear( );
inValue = Console.ReadLine( );
Console.WriteLine(ln );
Console.ReadKey( );

36 2015 Cengage Learning Computing Conference


Static using Statements
Static Math class has number of static members
using static System.Math;

Instead of writing
ans = Math.Pow(arg1, 3);
with additional using statement, write:
ans = Pow(arg, 3);

37 2015 Cengage Learning Computing Conference


Exception Filters
Add an if statement to catch clause for a
trycatchfinally statement

// body of catch clause

38 2015 Cengage Learning Computing Conference


String Interpolation

Previously would have written:


return String.Format("{0} {1}\nAmt: {2 :F2}", first, last, amt);

39 2015 Cengage Learning Computing Conference


Null Propagating Operator ?.
Saves you from writing lots of if statements

40 2015 Cengage Learning Computing Conference


Available
for fall
classes
Targets C#
6.0 with
Visual
Studio
2015

41 2015 Cengage Learning Computing Conference


Resources
Languages features in C# 6 and VB 14 -
https://github.com/dotnet/roslyn/wiki/Languages-
features-in-C%23-6-and-VB-14
VS2015 Preview features
http://www.visualstudio.com/en-us/news/vs2015-
preview-vs.aspx
Barbara Doyle, Jacksonville University
email: bdoyle@ju.edu

42 2015 Cengage Learning Computing Conference


Summing up!
New Visual Studio release anticipated Late
Spring/Summer 2015
Free Community Edition
Heavy emphasis on cross-platform development
opportunities
Xamarin partnership
Free student access with registration
No major enhancements with VS 2015 or C# 6.0
Everything is still subject to changestill a preview
after all
43 2015 Cengage Learning Computing Conference