1 / 82

Välkommen till Sommarkollo 2007

2006. Välkommen till Sommarkollo 2007. Visual Studio 2008. Agenda. Target vista & .NET 3.0 Handle Data Microsoft Office New Web Experience ALM. Wanna’ see a movie?. Friday the 6’th 15.00 Kista Centrum 100 seats for free. Visual Studio ”Orcas”. Support for distributed teams.

apu
Télécharger la présentation

Välkommen till Sommarkollo 2007

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2006 Välkommen till Sommarkollo 2007

  2. Visual Studio 2008

  3. Agenda • Target vista & .NET 3.0 • Handle Data • Microsoft Office • New Web Experience • ALM

  4. Wanna’ see a movie? • Friday the 6’th • 15.00 • Kista Centrum • 100 seats for free

  5. Visual Studio ”Orcas” Support fordistributed teams Tools for DB Pros JScript IntelliSense “My” support for.NET Framework 3.0 VSTS support fordevice development MFC forWindows Vista Load TestModeler Test-driven profiling Office Ribboncontrols WPF and WCFvisual designers Full AJAX support Language-integratedquery (LINQ) VB, XAML,andXML Refactoring Diagnostics supportfor WCF applications VSTO for 2007 Office system Windows Vistadebugging & profiling

  6. Framework Multitargeting • Choose which Framework version to target when building an application • .NET Framework 2.0 (Whidbey) • .NET Framework 3.0 (Vista) • .NET Framework 3.5 (Orcas) • VS IDE only shows feature appropriate for your selected target version • Toolbox, Add New Item, Add Reference, Add Web Reference, Intellisense, etc

  7. Framework Multitargeting

  8. Framework Multitargeting

  9. Framework Multitargeting Version = Assembly references + compilers No new CLR runtime .NET Fx 3.5 .NET Fx 3.0 .NET Fx 3.0 Update .NET Fx 2.0 .NET Fx 2.0Update .NET Fx 2.0 Update Vista Orcas Whidbey time

  10. Multi-targeting Scenarios • Framework 2.0 – no framework 3.0 required • Raw Vista Box – no Framework 3.5 • Enhanced scenarios – LINQ, AJAX, full framework 3.5 • Easy upgrade for current VS2005 Developers • Not available in Express SKUs

  11. Target vista & .NET 3.0

  12. Target Vista – C++ • Prepare for UAC – User Account Control • Embed manifest throughproperty in project • Leverage new controls • Task Dialog • Command Link • Split Button • Network Address • Sys Link • Use Aero style and appearance in your applications • http://msdn.microsoft.com/msdnmag/issues/07/06/Cpp/

  13. Windows Presentation Foundation • Visual Designer for WPF creates a seamless designer/developer workflow with Expression Blend • XAML-based editing directly in the IDE • Changes reflected in the designer in realtime • Control extensibility • Project templates, debugger & deployment support • Side-by-side support for Winforms • ElementHost in Toolbox • ClickOnce deployment support for WPF apps

  14. Windows Communication &Windows Workflow Foundation • Autohost for the hosting of WCF services • WSDL test client allows message injection (beta 2) • Hosting Wizard eases migration of services • New WCF Project templates include both the Autohost and Test Client into an out-of-the-box F5 experience • Simple item template for adding WCF services to an existing Project

  15. Windows Communication &Windows Workflow Foundation • Activities to consume WCF services • Function similarly to the InvokeWebService activity available today • Hosting extensions to expose WF workflows as WCF services • Messaging activities (send, receive) • A workflow hosting environment to handle instantiation and message routing

  16. Mobile Development • Works side-by-side with Visual Studio 2005 • In-box support for Windows Mobile 5.0 SDKs • Unit Testing Integration with Visual Studio Team System • Security Aware IDE • Device Emulator 3.0

  17. Create unit tests for device applications using the VSTS Unit Test infrastructure

  18. Ability to target multiple versions of the .NET Compact Framework runtime

  19. Device Security Manager makes it easy to deal with complex device security settings Easy to change the device into a specific security setting to test application under different security profiles Better understand current device security settings

  20. Device emulator offers the ability to emulate new hardware peripherals Device emulator emulating Windows Embedded CE 6.0 operating system

  21. Emulating a low battery scenario. This feature is very helpful for device developers to see how their application will behave in a low battery scenario on a real device

  22. Core Language Enhancements

  23. Extension Methods Extensionmethod namespace MyStuff { public static class Extensions { public static string Concatenate(this IEnumerable<string> strings, string separator) {…} } } Brings extensions into scope obj.Foo(x, y)  XXX.Foo(obj, x, y) using MyStuff; string[] names = new string[] { "Axel", "Mia", "Niels" }; string s = names.Concatenate(", "); IntelliSense!

  24. Object Initializers public class Point { private int x, y; public int X { get { return x; } set { x = value; } } public int Y { get { return y; } set { y = value; } } } Field or property assignments Point a = new Point { X = 0, Y = 1 }; Point a = new Point(); a.X = 0; a.Y = 1;

  25. Collection Initializers Must implement IEnumerable Must have public Add method List<int> numbers = new List<int> { 1, 10, 100 }; List<int> numbers = new List<int>(); numbers.Add(1); numbers.Add(10); numbers.Add(100); Add can take more than one parameter Dictionary<int, string> spellings = new Dictionary<int, string> { { 0, "Zero" }, { 1, "One" }, { 2, "Two" }, { 3, "Three" } };

  26. Anonymous Types IEnumerable<Contact> phoneListQuery = from c in customers where c.State == "WA" select new Contact { Name = c.Name, Phone = c.Phone }; + public class Contact { public string Name; public string Phone; }

  27. Anonymous Types class XXX { public string Name; public string Phone; } IEnumerable<XXX> var phoneListQuery = from c in customers where c.State == "WA" select new { Name = c.Name, Phone = c.Phone }; XXX foreach (var entry in phoneListQuery) { Console.WriteLine(entry.Name); Console.WriteLine(entry.Phone); }

  28. Expression TreesCode as Data public delegate bool Predicate<T>(T item); Predicate<Customer> test = c => c.State == "WA"; Predicate<Customer> test = new Predicate<Customer>(XXX); private static bool XXX(Customer c) { return c.State == "WA"; }

  29. Expression TreesCode as Data public delegate bool Predicate<T>(T item); Expression<Predicate<Customer>> test = c => c.State == "WA"; ParameterExpression c = Expression.Parameter(typeof(Customer), "c"); Expression expr = Expression.Equal( Expression.Property(c, typeof(Customer).GetProperty("State")), Expression.Constant("WA") ); Expression<Predicate<Customer>> test = Expression.Lambda<Predicate<Customer>>(expr, c);

  30. Automatic properties public class Product { public string Name; public decimal Price; }

  31. Automatic properties public class Product { string name; decimal price; public string Name { get { return name; } set { name = value; } } public decimal Price { get { return price; } set { price = value; } } }

  32. Automatic properties private string □; public string Name { get { return □; } set { □ = value; } } public class Product { public string Name { get; set; } public decimal Price { get; set; } } Must have both get and set

  33. C# 3.0 Language Innovations Query expressions var contacts = from c in customers where c.State == "WA" select new { c.Name, c.Phone }; Local variable type inference Lambda expressions var contacts = customers .Where(c => c.State == "WA") .Select(c => new { c.Name, c.Phone }); Extension methods Anonymous types Object initializers

  34. Handle Data

  35. Problem: Data != Objects

  36. <book> <title/> <author/> <year/> <price/> </book> Relational Objects XML The LINQ Project C# 3.0 VB 9.0 Others… .NET Language Integrated Query LINQ toObjects LINQ toDataSets LINQ toSQL LINQ toEntities LINQ toXML

  37. LINQ Operators

  38. Data Access In APIs Today Queries in quotes SqlConnection c = new SqlConnection(…); c.Open(); SqlCommand cmd = new SqlCommand( @"SELECT c.Name, c.Phone FROM Customers c WHERE c.City = @p0" ); cmd.Parameters.AddWithValue("@po", "London"); DataReader dr = c.Execute(cmd); while (dr.Read()) { string name = dr.GetString(0); string phone = dr.GetString(1); DateTime date = dr.GetDateTime(2); } dr.Close(); Arguments loosely bound Results loosely typed Compiler cannot help catch mistakes

  39. Data Access with LINQ public class Customer { public int Id; public string Name; public string City; public string Phone; } ---------------------------- GridView1.DataSource = from customer in db.Customers where customer.City == "London" select customer; GridView1.DataBind(); Classes describe data Query is natural part of the language The compiler provides IntelliSense and type-checking

  40. LINQ Architecture Others… C# VB .Net Language Integrated Query (LINQ) LINQ enabled data sources LINQ enabled ADO.NET LINQ To XML LINQ To Datasets LINQ To SQL LINQ To Entities LINQ To Objects <book> <title/> <author/> <price/> </book> Relational XML Objects

  41. LINQ Basics • Query Operators can be used against any .NET collection (IEnumerable<T>) • Built-in examples: Select, Where, GroupBy, Join, etc. • Extensibility model supports adding/replacing them • Query Expressions can operate on information sources and apply query operators against them to return IEnumerable<T> sequences

  42. Searching/Sorting an Array Array implements IEnumerable<T> • string [] cities = { “Auckland”, “Oslo”, “Sydney”, • “Seattle”, “Paris”, “Los Angeles” }; • IEnumerable<string> places = from city in cities • where city.Length > 5 • orderby city descending • select city; • GridView1.DataSource = places; • GridView1.DataBind(); LINQ Query Expression using Query Operators IEnumerable<string> sequence result can be used w/ databinding

  43. Projections • Sometimes you want to modify or transform the data you return from a query • LINQ enables powerful “data shaping” scenarios using projections • Can optionally be used in conjunction with new “anonymous type” compiler support

  44. Projections w/ Anonymous Types List<City> cities = CityUtilityHelper.GetCities(); var places = from city in cities where city.DistanceFromSeattle > 1000 select new { City = city.Name, Country = city.Country, DistanceInKm = city.DistanceFromSeattle * 1.61 }; GridView1.DataSource = places; GridView1.DataBind(); Anonymous type used to custom shape data results and apply miles->kilometer conversion

  45. Projections w/ Anonymous Types <asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server"> <Columns> <asp:BoundField HeaderText="Country" DataField="Country" /> <asp:BoundField HeaderText="City" DataField=“City" /> <asp:BoundField HeaderText="Dist (KM)" DataField="DistanceInKm" /> </Columns> </asp:GridView>

  46. LINQ for SQL • Maps .NET classes to relational SQL data • Translates LINQ queries to SQL execution • Supports change tracking for insert, update, delete operations • Built on top of ADO.NET and integrates with connection-pooling and transactions

  47. LINQ for SQL Basics public partial class Product { public int ProductID; public string ProductName; public Nullable<int> SupplierID; public Nullable<int> CategoryID; } public class NorthwindDataContext : DataContext { public Table<Product> Products; } NorthwindDataContext db = new NorthwindDataContext(); DataList1.DataSource = from product in db.Products where product.UnitsInStock > 0 select product; DataList1.DataBind();

  48. PK/FX Relationships in Database Products Table Suppliers Table Categories Table Foreign Key Relationships to the Suppliers and Categories Tables

More Related