Presentation is loading. Please wait.

Presentation is loading. Please wait.

Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Similar presentations


Presentation on theme: "Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0."— Presentation transcript:

1 Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0

2 Was ist Whidbey? Code Name für … die nächste Version vom.NET Framework … die nächste Version von C#, Visual Basic.NET … die nächste Version von Visual Studio Voraussichtliche Produktnamen ….NET Framework 2.0 … Visual Studio 2005

3 Agenda Was ist neu in… ? ….NET Framework (BCL) … Spracherweiterungen / CTS … Windows Forms 2.0 … ASP.NET 2.0 … ADO.NET 2.0 … Visual Studio 2005 … Noch einiges mehr

4 Drucken ist erheblich einfacher Private Sub Button1_Click(…) Handles Button1.Click With My.Computer.Printer.WriteLine("Circuit Board ID: " & _ txtCircuitBoardID.Text).WriteLine("Date Printed: " & Now).WriteLine(PictureBox1.Image).WriteHorizontalLine(Height:=3).WriteLine("Test Data").WriteLine(TextBox1.Text).Print(PreviewDialog:=True) End With End Sub Private Sub Button1_Click(…) Handles Button1.Click With My.Computer.Printer.WriteLine("Circuit Board ID: " & _ txtCircuitBoardID.Text).WriteLine("Date Printed: " & Now).WriteLine(PictureBox1.Image).WriteHorizontalLine(Height:=3).WriteLine("Test Data").WriteLine(TextBox1.Text).Print(PreviewDialog:=True) End With End Sub Private Sub Button1_Click(…) Handles Button1.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub Private Sub PrintDocument1_PrintPage(…) Handles PrintDocument1.PrintPage Dim font As New Font("Arial", 10) Dim brush As Brush = Brushes.Black Dim X As Integer = 50 Dim Y As Integer = 50 Dim LineHeight As Integer = 20 With e.Graphics.DrawString("Circuit Board ID: " & _ txtCircuitBoardID.Text, font, _ brush, X, Y) Y = Y + LineHeight.DrawString("Date Printed: " & Now, font, _ brush, X, Y) Y = Y + LineHeight.DrawImage(PictureBox1.Image, X, Y) Y = Y + LineHeight + _ PictureBox1.Image.Height.DrawLine(Pens.Black, X, Y, 750, Y) Y = Y + LineHeight.DrawString("Test Data", font, brush, X, Y) Y = Y + LineHeight.DrawString(TextBox1.Text, font, brush, X, Y) End With End Sub Private Sub Button1_Click(…) Handles Button1.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub Private Sub PrintDocument1_PrintPage(…) Handles PrintDocument1.PrintPage Dim font As New Font("Arial", 10) Dim brush As Brush = Brushes.Black Dim X As Integer = 50 Dim Y As Integer = 50 Dim LineHeight As Integer = 20 With e.Graphics.DrawString("Circuit Board ID: " & _ txtCircuitBoardID.Text, font, _ brush, X, Y) Y = Y + LineHeight.DrawString("Date Printed: " & Now, font, _ brush, X, Y) Y = Y + LineHeight.DrawImage(PictureBox1.Image, X, Y) Y = Y + LineHeight + _ PictureBox1.Image.Height.DrawLine(Pens.Black, X, Y, 750, Y) Y = Y + LineHeight.DrawString("Test Data", font, brush, X, Y) Y = Y + LineHeight.DrawString(TextBox1.Text, font, brush, X, Y) End With End Sub Visual Basic.NET 2003Visual Basic Whidbey

5 The.NET Framework A Once in a Decade Change PDC 2000 Paradigm Shift –Web services –Managed Code 198019902000 Richness Win16 Win32 COM MFC Components Services APIs Windows 3.0

6 Landmarks To Date Running in over 60% of Fortune 100 More than 70M systems with.NET Framework Strong developer ecosystem ISO standardization

7 Tools Client Application Model Windows Forms Web & Service Application Model ASP.NET Compact Framework Yukon Data Systems Application Model Presentation Mobile PC & Devices Application Model Communication Command Line NT Service System.Messaging System.DirectoryServices System.Runtime.Remotin g System.Windows.Forms System.Console System.ServiceProces s System.Windows.Form s System.Web System.Data.SqlServer HttpWebRequest FtpWebListener SslClientStream WebClient System.Net NetworkInformation Sockets Cache System.Windows.Forms Forms Control Print Dialog Design System.Web.UI Page Control HtmlControls MobileControls WebControls Adaptors Design System.Drawing System.Web.Service s Web.Service Description Discovery Protocols System.Timers System.Globalization System.Serialization System.Threading System.Text System.Design Serialization CompilerServices Base & Application Services Fundamentals System.ComponentModel System.CodeDom System.Reflection System.EnterpriseServices System.Transactions Security System.Web. Security AccessControl Credentials Cryptography System.Web.Configuration System.Configuration System.Resources System.Management System.Deployment System.Diagnostics ConfigurationDeployment/Management Ports InteropServices System.Runtime System.IO System.Collections Generic Permissions Policy Principal Token System.Security System.Web Administration Management.NET Framework Whidbey Data System.Web Personalization Caching SessionState System.Xml Schema Serializatio n Xpath Query DataSet Mapping ObjectSpaces ObjectSpace Query Schema System.Data SqlClient SqlTypes SqlXML OdbcClient OleDbClient OracleClient

8 Base Innovations 64-bit Support Performance Edit and Continue Base Library Enhancements Generics

9 Innovations In Data Access ADO.NET –No Model Changes –Advanced Features –Performance System.Xml –Performance –XQuery ObjectSpaces –Builds on ADO.NET –Domain objects: Customer, Order, Address

10 Innovations In Data Access: SQL Server Yukon Extend SQLs type system, stored procs, functions, triggers in managed code Leverage broad developer ecosystem Wide choice of languages –Visual Basic, C#, MC++, COBOL, …and T-SQL Leverages much of the.NET Framework –BCL, network access, Web services… Enable third parties to write libraries to extend the DB

11 Innovations On The Web ASP.NET Whidbey Reduce plumbing code by 70% Building Blocks Page Framework 40+ New ASP.NET controls

12

13 Innovations For Devices Mobile capabilities for all ASP.NET controls Tablet PC SDK extends the core Framework Improvements in.NET Compact Framework security, performance and interoperability

14 Road To Longhorn All building on the.NET Framework –Delivering amazing new user experiences with Avalon –Extending Web services to the client with Indigo –Everyday info with WinFS Richness Win16 Win32 COM MFC Components Services APIs Windows 3.0 WinFX.NET Framework Whidbey

15 Related Longhorn Era Technologies Windows Forms –Works great on Longhorn! –Two-way interop with Avalon –See: CLI391 Windows Forms: Exploiting Windows Longhorn Features from Within Your Application ASMX,.NET Remoting and Enterprise Services –All work great on Longhorn! –Indigo unifies RPC style programming –See: WSV203 Indigo: Connected Application Technology Roadmap

16 Summary Whidbey Design Goals –Deliver on the Fundamentals: Security, Deployment, Manageability, Performance –Enhanced Productivity –Path to the Future WinFX

17 Tools Client Application Model AvalonWindows Forms Web & Service Application Model ASP.NET / Indigo Win FS Compact Framework Yukon Mobile PC Optimized System.Help System.Drawing System.NaturalLanguageServices Data Systems Application Model Presentation Data Mobile PC & Devices Application Model Communication Command Line NT Service DataSet Mapping ObjectSpaces ObjectSpace Query Schema Item Relationship Media Audio Video Images System.Messaging System. Discovery System.DirectoryServices System.Remoting System.Runtime.Remoting Active Directory Uddi System.Web.Services Web.Service Description Discovery Protocols System.MessageBus Transport Port Channel Service Queue PubSub Router System.Serialization System.Threading System.Text System.Design Base & Application Services Fundamentals System.ComponentModel System.CodeDom System.Reflection System.EnterpriseServices System.Transactions Security System.Windows. TrustManagement System.Web. Security System.Message Bus.Security Authorization AccessControl Credentials Cryptography System.Web.Configuration System.MessageBus.Configuration System.Configuration System.Resources System.Management System.Deployment System.Diagnostics ConfigurationDeployment/Management System.Windows System.Windows.Forms System.Console System.ServiceProcess System.Windows.Forms System.Web System.Storage System.Data.SqlServer Animation Controls Control Design Panel Controls Dialogs SideBar Notification System.Windows Documents Text Element Shapes Shape Ink UI Element Explorer Media System.Windows.Forms Forms Control Print Dialog Design System.Web.UI Page Control HtmlControls MobileControls WebControls Adaptors Design Ports InteropServices System.Runtime System.IO System.Collections Generic System.Search Annotations Monitoring Logging Relevance System.Data SqlClient SqlTypes SqlXML OdbcClient OleDbClient OracleClient Core Contact Location Message Document Event System.Storage System.Web Personalization Caching SessionState System.Xml Schema Serialization Xpath Query Permissions Policy Principal Token System.Security System.Collaboration RealTimeEndpoint TransientDataSession SignalingSession Media Activities HttpWebRequest FtpWebListener SslClientStream WebClient System.Net NetworkInformation Sockets Cache System.Web Administration Management Navigation Peer Group Policy Serialization CompilerServices Recognition System.Speech Synthesis System System.Globalization

18 Talk Focus This talk is focused on –Features which enable you to be more productive (write your code more quickly) –Features which allow you to write faster, or more resource aware code –Features which YOU asked for! (more managed solutions)

19 Agenda Topic Breakdown Productivity Ease-Of-Use Faster, Resource Aware IO New Managed Solutions Friend Assemblies Strongly Typed Resources RAD Debugging Generics TryParse Memory Pressure EventLog Environment Tracing SerialPort Console Threading

20 Agenda Increased Productivity IO Friend Assemblies Strongly Typed Resources RAD Debugging Increased Productivity, Ease-Of-Use Faster code-development by being simpler to use, and easier to find Generics TryParse Memory Pressure EventLog Environment Tracing SerialPort Console Threading

21 Strongly-Typed Resources In this demo, well see how working with resources has become even easier, with strongly-typed resources

22 Private/Dim ??? private ??? protected Internal protected internal public Protected Friend Protected Friend Public Friend Assemblies Today, you have these options… class Foo {} class SubFoo : Foo {} class SomeClassA {} class Foo {} class SubFoo : Foo {} class SomeClassA {} class SubFoo2 : Foo {} class SomeClassB {} class SubFoo2 : Foo {} class SomeClassB {} class SomeClassC {} C# VB AssemA AssemB AssemC How can AssemA make itself visible to everything in AssemB, but NOT AssemC? How can AssemA make itself visible to everything in AssemB, but NOT AssemC?

23 Applies to assemblies only Step 2 Reference the class! class Bar { Foo f = new Foo(); } Friend Assemblies Using InternalsVisibleToAttribute [assembly:InternalsVisibleTo(AssemB, PublicKeyToken=32ab4ba45e0a69a1 )] internal class Foo { public Foo() {} } Step 1 Apply the attribute AssemB// wants to access Foo AssemA

24 Agenda Faster, Resource Aware Code Faster, Resource Aware code Code that runs faster, and more often IO Friend Assemblies Strongly Typed Resources RAD Debugging Generics TryParse Memory Pressure EventLog Environment Tracing SerialPort Console Threading

25 public class List { private object[] elements; private object[] elements; private int count; private int count; public void Add(object element) { public void Add(object element) { if (count == elements.Length) Resize(count * 2); if (count == elements.Length) Resize(count * 2); elements[count++] = element; elements[count++] = element; } public object this[int index] { public object this[int index] { get { return elements[index]; } get { return elements[index]; } set { elements[index] = value; } set { elements[index] = value; } } public int Count { public int Count { get { return count; } get { return count; } }} public class List public class List { private T [] elements; private T [] elements; private int count; private int count; public void Add( T element) { public void Add( T element) { if (count == elements.Length) Resize(count * 2); if (count == elements.Length) Resize(count * 2); elements[count++] = element; elements[count++] = element; } public T this[int index] { public T this[int index] { get { return elements[index]; } get { return elements[index]; } set { elements[index] = value; } set { elements[index] = value; } } public int Count { public int Count { get { return count; } get { return count; } }} Generics List intList = new List(); intList.Add(1);intList.Add(2);intList.Add("Three"); int i = (int)intList[0]; List intList = new List(); intList.Add(1); // Argument is boxed intList.Add(2); // Argument is boxed intList.Add("Three"); // Should be an error int i = (int)intList[0]; // Cast required List intList = new List (); intList.Add(1); // No boxing intList.Add(2); // No boxing intList.Add("Three"); // Compile-time error int i = intList[0]; // No cast required Before Generics

26 Generics In VB Public Class List(Of T) Private elements() As T Private elements() As T Private elementcount As Integer Private elementcount As Integer Public Sub Add(ByVal element As T) Public Sub Add(ByVal element As T) If elementcount = elements.Length Then Resize(elementcount * 2) If elementcount = elements.Length Then Resize(elementcount * 2) elements(elementcount) = element elements(elementcount) = element count += 1 count += 1 End Sub End Sub Public Default Property Item(ByVal index As Integer) As T Public Default Property Item(ByVal index As Integer) As T Get Get Return elements(index) Return elements(index) End Get End Get Set (ByVal Value As T) elements(index) = Value Set (ByVal Value As T) elements(index) = Value End Set End Set End Property End Property Public ReadOnly Property Count As Integer Public ReadOnly Property Count As Integer Get Get Return elementcount Return elementcount End Get End Get End Property End Property End Class Dim intList As New List(Of Integer) intList.Add(1) // No boxing intList.Add(2) // No boxing intList.Add("Three") // Compile-time error Dim i As Integer = intList(0) // No cast required

27 Generics In C++ generic generic public ref class List { array ^ elements; array ^ elements; int count; int count;public: void Add(T element) { void Add(T element) { if (count == elements->Length) Resize(count * 2); if (count == elements->Length) Resize(count * 2); elements[count++] = element; elements[count++] = element; } property T default [int index] { property T default [int index] { T get() { return elements[index]; } T get() { return elements[index]; } void set(T value) { elements[index] = value; } void set(T value) { elements[index] = value; } } property int Count { property int Count { int get() { return count; } int get() { return count; } }}; List ^ intList = gcnew List (); intList->Add(1); // No boxing intList->Add(2); // No boxing intList->Add("Three"); // Compile-time error int i = intList[0]; // No cast required

28 Enhancing The Base Library Generic Collections System.Collections.Generic classes –List –Dictionary –Stack –Queue System.Collections.Generic interfaces –IList –IDictionary –ICollection –IEnumerable –IEnumerator –IComparable –IComparer

29 Enhancing The Base Library Other Generics to look out for Nullable –Extremely useful for situations where null is a value, such as database valuetypes Nullable intVal = Nullable.default; intVal = 5; // implicit cast from int int i = (int)intVal; // explicit cast to int if (intVal.HasValue) { // checks for a value EventHandler –Saves on making your own EventHandlers delegate void EventHandler (Object sender, T e) where T : EventArgs;

30 Enhancing The Base Library Other Generics to look out for IComparable –No boxing of valuetypes on comparison/sorting –No chance of passing in an invalid type public class DemoString : IComparable { public int CompareTo(string other) ; public bool Equals(string other); } ArraySegment –Allows you to easily specify a subsection of an array –Supports cleaner API design Constructor: public ArraySegment(T[] array, int offset, int count); Old API: public void Send ( byte[], int, int ); New API: public void Send ( ArraySegment );

31 Speeding Things Up: Parsing Values In this demo, we'll see how TryParse can save you precious milliseconds, when comparing it to the traditional Parse routines

32 Threading Semaphore Resource counting for mutexs // construct a semaphore with a count of 2 Semaphore sem = new Semaphore(2); private void UseResource { // Wait until a count is available… sem.WaitOne(); // the sem count is reduced by one // other code … // Release the count: sem.Release(); // the count is incremented by one

33 Agenda New Managed Solutions IO Friend Assemblies Strongly Typed Resources RAD Debugging Generics TryParse Memory Pressure EventLog Environment Tracing SerialPort Console New Managed Solutions Managed solutions which werent available in V2003 Threading

34 Console: Additional Features In this demo, well see additional Console features making the Console a more robust experience

35 Others… New String APIs, to make tasks easier, and make the most appropriate code easier –Remove( startIndex ) –Contains ( someString ) –Split ( char(), omitEmptyEntries ) IO ACLs Named Events in Threading Timing out streams IO: Decompression support Transactions RegularExpressions: character class subtraction Performant scenarios for resources

36 Summary Features have been introduced to provide: –An easier, better programming experience –Faster, more resource aware code –More managed solutions Focus has been on evolution, not revolution Keep those requests coming! Features have been introduced to provide: –An easier, better programming experience –Faster, more resource aware code –More managed solutions Focus has been on evolution, not revolution Keep those requests coming!

37 Designer Features

38 More in-situ design experience, reduce obligatory visits to –the property grid –toolbars –menus Streamline common tasks –reduce clicks –reduce amount of code necessary

39 Feature List Snaplines Smart tags New selection UI / Semi-transparent dragging In-situ string property editing Document Outline Toolbox improvements Control Position / Size in Statusbar Runtime Features –Visual Styles –GDI Text

40 Snaplines Replaces grid layout mode In-situ alignment (natural extension of IDE toolbar items Align Tops, etc.) Like snaps to like (e.g. left border to left, etc.), exposes margins/padding Controls can expose interesting points –TextBox and Label baseline snapline

41 Snaplines (cont) New features: –Respects the new padding and margin properties on controls –These values will be set to Windows UI style guidelines –Works for resize operations –Supports multiselection –Initial control creation

42 In-Situ String Editing Ability to edit a single property for all controls at once. Similar to tab order editor in v1.1 Only works for string properties

43 Smart Tasks In-situ tasks, immediate Extensible by 3 rd parties

44 New Selection UI Reduced number of handles Reduced size of UI Rounded to look good with visual styles... but still tweaking...

45 Dragging UI Improvements Real-time control rendering -- WYSIWYG Semi-transparent

46 Document Outline View Not just for HTML anymore! Allows easy control navigation, Z-order modification, parenting

47 Toolbox Improvements Auto-population Informative tooltips Search/filter

48 Location / Size information in the Statusbar

49 Visual Styles Visual styles just work and are on by default –Setting the FlatStyle property is no longer necessary –Manifest is no longer necessary VS and the design experience will support visual styles Visual Style APIs –High level control based API for common drawing operations –Low level theme API for drawing theme parts –Low level API will be strongly typed for the beta –Works in semi trust

50 GDI Text Rendering GDI+ text is resolution independent –It doesnt look like GDI text GDI text benefits from 10+ years of hardware acceleration GDI text has better globalization character set support on XP and above

51 GDI Text Continued Added System.Windows.Forms.GDI namespace Added a new TextRender class for text drawing –Provides a stateless API Added new WindowsFont class to encapsulate GDI fonts All Windows Forms controls use GDI text by default

52 ClientServerOfficeClientServerOffice

53 Fragen?


Download ppt "Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0."

Similar presentations


Ads by Google