.NET 4.0

2,430 views

Published on

This is a slide deck on .NET 4.0. Intertech offers a course on the differences between .NET 4.0 and 3.X. http://www.intertech.com/Courses/Course.aspx?CourseID=99500

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,430
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

.NET 4.0

  1. 1. Intertech’s Oxygen Blast Series June 2010 An Intertech Course
  2. 2.  Welcome! This Intertech Oxygen Blast presentation will provide an overview of some key aspects found with the release of .NET 4.0:  Various C# and VB language changes.  Introduce some new APIs (TPL, PLINQ).  Survey some changes to the Ws (WPF, WCF, WF). Copyright © Intertech, Inc. 2010 Slide 2 http://www.Intertech.com | 800-866-9884
  3. 3.  Be aware that this short overview cannot cover *every* possible change brought forth with .NET 4.0.  Please consult the .NET 4.0 SDK Framework Documentation for full details.  Simply look up the topic "What's New in the .NET Framework 4“. Note the local help system is now hosted by your web browser! Copyright © Intertech, Inc. 2010 Slide 3 http://www.Intertech.com | 800-866-9884
  4. 4.  Microsoft has stated that they intend to keep C# and VB fairly similar with regard to feature release.  With .NET 4.0, C# now supports a number of features VB developers have used for some time (optional args, named args, dynamic typing).  In contrast VB (with the release of .NET 4.0) now has features C# has supported for quite some time (full support for lambdas).  Today, the only *real* differences between C# and VB are…  C# supports pointer types.  VB supports XML literal syntax (and some backwards compat with VB6).  (humm…which feature would YOU rather use ;-) Copyright © Intertech, Inc. 2010 Slide 4 http://www.Intertech.com | 800-866-9884
  5. 5.  C# now supports optional arguments.  This language feature allows the caller to omit specifying values to parameters they don’t care about.  If unspecified, they will receive default values. static void EnterLogData(string message, string owner = "Programmer") { Console.WriteLine("Error: {0}", message); Console.WriteLine("Owner of Error: {0}", owner); } static void Main(string[] args) { ... EnterLogData("Oh no! Grid can't find data"); EnterLogData("Oh no! I can't find the payroll data", "CFO"); } Copyright © Intertech, Inc. 2010 Slide 5 http://www.Intertech.com | 800-866-9884
  6. 6.  The values assigned to optional arguments must be known at compile time.  Thus, the following is a compile time error. // Error! The default value for an optional arg must be known // at compile time! static void EnterLogData(string message, string owner = "Programmer", DateTime timeStamp = DateTime.Now) { Console.WriteLine("Error: {0}", message); Console.WriteLine("Owner of Error: {0}", owner); Console.WriteLine("Time of Error: {0}", timeStamp); } Copyright © Intertech, Inc. 2010 Slide 6 http://www.Intertech.com | 800-866-9884
  7. 7.  This language feature simplifies method overloading.  Rather than defining n number of overloaded methods, you can define 1 method with optional args.  Consider the following constructor chaining example. class Employee { // Master constructor. Does the real work. public Employee(string fName, string lName, string favoriteColor) { // Process data. } class Employee { // Forward the call to the master. // A single constructor, with optional args. public Employee() public Employee(string fName = "", string lName = "", :this("", "", "Purple") string favoriteColor = "Purple") {} { // Process data. public Employee(string fName, string lName) } : this(fName, lName, "Purple") } {} } Copyright © Intertech, Inc. 2010 Slide 7 http://www.Intertech.com | 800-866-9884
  8. 8.  C# also now supports named parameters.  This feature allows you to pass data to a method in any order you choose.  Simply doing so for no reason results in confusing code; however as you will see, this feature can simplify COM interop tasks. static void DisplayFancyMessage(ConsoleColor textColor, ConsoleColor backgroundColor, // This is OK, as positional args are listed before named args. string message) DisplayFancyMessage(ConsoleColor.Blue, { message: "Testing...", // Store old colors to restore once message is printed. backgroundColor: ConsoleColor.White); ConsoleColor oldTextColor = Console.ForegroundColor; ConsoleColor oldbackgroundColor = Console.BackgroundColor; // This is an ERROR, as positional args are listed after named args. DisplayFancyMessage(message: "Testing...", // Set new colors and print message. backgroundColor: ConsoleColor.White, Console.ForegroundColor = textColor; ConsoleColor.Blue); Console.BackgroundColor = backgroundColor; Console.WriteLine(message); // Restore previous colors. Console.ForegroundColor = oldTextColor; Console.BackgroundColor = oldbackgroundColor; } Copyright © Intertech, Inc. 2010 Slide 8 http://www.Intertech.com | 800-866-9884
  9. 9.  C#, is now a (partial) scripting language…  The CLR has a new little brother named the DLR (Dynamic Language Runtime).  The DLR processes “expression trees” that encapsulate details regarding runtime method invocation.  In C#, expression trees are assemblies automatically via the dynamic keyword.  Assignments are evaluated entirely at runtime! static void InvokeMembersOnDynamicData() { dynamic textData1 = "Hello"; Console.WriteLine(textData1.ToUpper()); // You would expect compiler errors here! // But they compile just fine. // Runtime error, toupper() is wrong case. Console.WriteLine(textData1.toupper()); // Runtime error, string does not have a method named foo() taking 3 args! Console.WriteLine(textData1.Foo(10, "ee", DateTime.Now)); } Copyright © Intertech, Inc. 2010 Slide 9 http://www.Intertech.com | 800-866-9884
  10. 10.  You are correct to assume that using the dynamic keyword just for the sake of doing so is very poor programming practice.  However, in a few circumstances, the dynamic keyword can radically reduce the amount of code you need to author by hand.  Specifically, if you are building a .NET application which makes heavy use of late binding (via reflection), the dynamic keyword can save you typing time.  As well, if you are building a .NET application that needs to communicate with legacy COM libraries (such as Microsoft Office products), you can greatly simplify your codebase via the dynamic keyword. Demo! Copyright © Intertech, Inc. 2010 Slide 10 http://www.Intertech.com | 800-866-9884
  11. 11.  The dynamic keyword (and the DLR) also simplify reflection tasks.  Consider the following reflection task, with (and without) dynamic. static void CreatePersonWithLateBinding() { // Get type info of Person using C# typeof operator. Type personType = typeof(CSharpDLR.Person); // Create object using Activator.CreateInstance(). object[] ctorArgs = new object[] { "Fred", "Flintstone", 40 }; object o = Activator.CreateInstance(personType, ctorArgs); static void CreatePersonWithDynamicKeyword() // Change Age property using late binding. { PropertyInfo pi = personType.GetProperty("Age"); // Get type info of Person using C# typeof operator. pi.SetValue(o, 42, null); Type personType = typeof(CSharpDLR.Person); // Invoke ToString() using late binding. // Create object using Activator.CreateInstance(). MethodInfo mi = personType.GetMethod("ToString"); object[] ctorArgs = new object[] { "Fred", "Flintstone", 40 }; Console.WriteLine(mi.Invoke(o, null)); dynamic o = Activator.CreateInstance(personType, ctorArgs); } // Change property and call method dynamically. o.Age = 42; Console.WriteLine(o.ToString()); } Copyright © Intertech, Inc. 2010 Slide 11 http://www.Intertech.com | 800-866-9884
  12. 12.  As of .NET 4.0, VB has a number of new language features.  Automatic properties.  Collection initialization syntax.  Implicit line continuation (best change of the release, IMHO).  Multiline lambda expressions.  Lambda expressions with no return value (Sub). Copyright © Intertech, Inc. 2010 Slide 12 http://www.Intertech.com | 800-866-9884
  13. 13.  Automatic properties allow you to gain simple, easy encapsulation of state data.  This is only useful for data which does not need any custom error checking, validation, etc.  Must be read/write.  The compiler generates a private backing field and implements the Get / Set for you.  If required, you can set up the initial value at the time you author the property. Private _fName As String = "" Property FirstName As String Get Return _fName End Get Property FirstName As String = "" Set(ByVal value As String) _fName = value End Set End Property Copyright © Intertech, Inc. 2010 Slide 13 http://www.Intertech.com | 800-866-9884
  14. 14. Module Program Sub Main() Dim people As New List(Of Person) From _ { _ New Person("Fred", "Flintstone", 45), _ New Person("Homer", "Simpson", 45) _  The next VB 2010 language End Sub } feature is support for collection End Module initialization syntax.  Historically, hydrating a collection Module Program ' Error! Can not combine object / collection init syntax! object (such as an ArrayList or Sub Main() List(Of T) ) requires you to call the Dim people As New List(Of Person) From _ { _ Add() method numerous times. New Person(){FirstName="Fred", _  As of .NET 4.0, we can now LastName="Flintstone", Age=45), _ New Person(){FirstName="Homer", _ hydrate a collection object using LastName="Simpson", Age=45) _ the From keyword and a defined } End Sub curly bracket scope. End Module  Also, remember, no more line continuation character! Module Program Sub Main() Dim people As New List(Of Person) From { New Person("Fred", "Flintstone", 45), New Person("Homer", "Simpson", 45) } End Sub Copyright © Intertech, Inc. 2010 Slide 14 End Module http://www.Intertech.com | 800-866-9884
  15. 15.  The biggest change in VB 2010 is improved support for lambda expressions.  Recall! A lambda expression (in C# or VB) is a shorthand notation for working with delegates.  Before .NET 4.0, VB lambdas were very limited.  They had no support for multiline lambdas; no support for subroutines.  Therefore, VB 3.5 lambdas could only process a single statement which returned a value!  Both of these issues are corrected with .NET 4.0. Demo! Copyright © Intertech, Inc. 2010 Slide 15 http://www.Intertech.com | 800-866-9884
  16. 16.  .NET 4.0 introduces a brand new API for building multithreaded applications.  The Task Parallel Library (TPL) provides a way to easily distribute a workload across multiple processors.  The CLR will pull threads from the thread pool when necessary. Thus, there are little ways to customize the threads (they will be normal priority, background threads).  Using the types of System.Threading.Tasks, you can build fine-grained, scalable parallel code without having to work directly with threads or the thread pool.  Furthermore, when you do so, you can make use of strongly typed LINQ queries (via "parallel LINQ", or PLINQ) to divide up your workload. Copyright © Intertech, Inc. 2010 Slide 16 http://www.Intertech.com | 800-866-9884
  17. 17.  The primary class of the TPL is System.Threading.Tasks.Parallel.  This class supports a number of methods which allow you to iterate over a collection of data (specifically, an object implementing IEnumerable<T>) in a parallel fashion.  If you were to look up the Parallel class in the .NET Framework 4.0 SDK documentation, you'll see that this class supports two primary static methods, Parallel.For() and Parallel.ForEach(), each of which defines numerous overloaded versions. Copyright © Intertech, Inc. 2010 Slide 17 http://www.Intertech.com | 800-866-9884
  18. 18.  Both of these methods require you to specify an IEnumerable or IEnumerable<T> compatible container that holds the data you need to process in a parallel manner.  The container could be a simple array, a non-generic collection (such as ArrayList), a generic collection (such as List<T>) or the results of a LINQ query.  In addition, you will need to make use of the System.Func<T> and System.Action<T> delegates to specify the target method which will be called to process the data.  Recall that Func<T> represents a method which can have a given return value and a varied number of arguments.  The Action<T> delegate is very similar to Func<T>, in that it allows you to point to a method taking some number of parameters. However, Action<T> specifies a method which can only return void (a VB Sub).  While you could call the Parallel.For() and Parallel.ForEach() methods and pass a strongly typed Func<T> or Action<T> delegate object, you can simplify your programming by making use of a fitting lambda expression. Copyright © Intertech, Inc. 2010 Slide 18 http://www.Intertech.com | 800-866-9884
  19. 19. // C# code (VB code would be similar) // Process the image data in a blocking manner. foreach (string currentFile in files) { string filename = Path.GetFileName(currentFile); using (Bitmap bitmap = new Bitmap(currentFile)) { bitmap.RotateFlip(RotateFlipType.Rotate180FlipNone); bitmap.Save(Path.Combine(newDir, filename)); this.Text = string.Format("Processing {0} on thread {1}", filename, Thread.CurrentThread.ManagedThreadId); } } // C# code (VB code would be similar) // Process the image data in a parallel manner! Parallel.ForEach(files, currentFile => { string filename = Path.GetFileName(currentFile); Notice the use of a lambda, using (Bitmap bitmap = new Bitmap(currentFile)) Rather than an Action<> { bitmap.RotateFlip(RotateFlipType.Rotate180FlipNone); delegate. bitmap.Save(Path.Combine(newDir, filename)); this.Text = string.Format("Processing {0} on thread {1}", VB programmers would use a filename, Thread.CurrentThread.ManagedThreadId); Sub / End Sub multiline lambda. } } ); Copyright © Intertech, Inc. 2010 Slide 19 http://www.Intertech.com | 800-866-9884
  20. 20.  The Task class can be very useful when you need to process data, in parallel, while keeping the primary thread responsive.  GUI applications can make use of Task to invoke a method using the TPL.  The method pointed to will execute on a secondary thread.  This is a simplified approach to working with anonymous delegates or System.Threading types. // C# code (VB code would be similar) private void btnProcessImages_Click(object sender, EventArgs e) { // Start a new "task" to process the files. Task.Factory.StartNew(() => { ProcessFiles(); The Factory property of Task returns }); a TaskFactory object. } When you call its StartNew() method, you pass in an Action<T> delegate (here, hidden away with a fitting lambda expression) which points to the method to invoke in an asynchronous manner. Copyright © Intertech, Inc. 2010 Slide 20 http://www.Intertech.com | 800-866-9884
  21. 21.  In addition to data parallelism, the TPL can also be used to easily fire off any number of asynchronous tasks using the Parallel.Invoke() method.  This approach is a bit more straightforward than using delegates or members from System.Threading.  However if you require more control over the way tasks are executed, you could forgo use of Parallel.Invoke() and make use of the Task class directly, as we did in the previous example. // C# code (VB code would be similar) private void btnDoWork_Click(object sender, EventArgs e) { string[] resultOne; FileInfo[] resultTwo; // Do two complex task in parallel. Action<> Parallel.Invoke( Delegate 1 () => { // Fire up first complex task. resultOne = ComplexWork(); }, () => { Action<> // Fire up second complex task. resultTwo = MoreComplexWork(); Delegate 2 }); } Copyright © Intertech, Inc. 2010 Slide 21 http://www.Intertech.com | 800-866-9884
  22. 22.  If you wish, you can make use of a new set of extension methods, which allow you to construct a LINQ query that will perform its workload in parallel (if possible).  Fittingly, LINQ queries that are designed to run in parallel are termed PLINQ queries.  The necessary extension methods are found within the ParallelEnumerable class of the System.Linq namespace. Member Meaning in Life AsParallel() Specifies that the rest of the query should be parallelized. WithCancellation() Specifies that PLINQ should periodically monitor the state of the provided cancellation token and cancel execution if it is requested. WithDegreeOfParallelism() Specifies the maximum number of processors that PLINQ should use to parallelize the query. ForAll() Enables results to be processed in parallel without first merging back to the consumer thread, as would be the case when enumerating a LINQ result using the foreach keyword. Copyright © Intertech, Inc. 2010 Slide 22 http://www.Intertech.com | 800-866-9884
  23. 23. // C# code (VB code would be similar) public partial class MainForm : Form { ... private void btnExecute_Click(object sender, EventArgs e) { // Start a new "task" to process the ints. Task.Factory.StartNew(() => { ProcessIntData(); }); Demo! } private void ProcessIntData() { // Get a very large array of integers. int[] source = Enumerable.Range(1, 10000000).ToArray(); // Find the numbers where num % 3 == 0 is true, returned // in descending order. int[] modThreeIsZero = (from num in source.AsParallel() where num % 3 == 0 orderby num descending select num).ToArray(); MessageBox.Show(string.Format("Found {0} numbers that match query!", modThreeIsZero.Count())); } } Copyright © Intertech, Inc. 2010 Slide 23 http://www.Intertech.com | 800-866-9884
  24. 24.  WPF 4.0 ships with a number of useful updates, all of which are documented in the help system. Some of the more useful include:  The API now provides a DataGrid, Calendar and DataPicker controls (which are compatible with the equivalent SL controls).  Support for touch-based input.  A number of “animation easings” have been added to the System.Windows.Media.Animation namesapce to apply common physics to a WPF animation (bounce, spring, snap, etc).  Perhaps one of the biggest changes is support for the Visual State Manager (VSM)… Copyright © Intertech, Inc. 2010 Slide 24 http://www.Intertech.com | 800-866-9884
  25. 25.  The VSM is a new way to incorporate visual cues to a custom ControlTemplate.  Using the VSM, you can define any number of animations which are associated to a uniquely named “visual state”.  Via code or XAML, you can change states based on some condition (mouse over, mouse up, has focus, etc).  Essentially, the VSM is an alternative to the original “trigger” framework.  As you might know, the VSM was first introduced in Silverlight.  As of WPF 4.0, you can forgo triggers and opt for the VSM.  This alone can help simplify the construction of XAML which works well under both the WPF and SL frameworks. Demo! VS 2010 Too! Copyright © Intertech, Inc. 2010 Slide 25 http://www.Intertech.com | 800-866-9884
  26. 26.  On a related note, given that VS 2010 has a “proper” WPF / SL designer, what is the role of Blend?  Blend is still a key aspect of WPF/SL development.  VS 2010 has no support for working with the VSM or animation timelines (beyond a healthy amount of typing).  VS 2010 has no support for converting graphical renderings (via Shapes) to custom UserControl classes. Regardless of the useful WPF/SL designers of VS 2010, Blend is a key productivity boost. Copyright © Intertech, Inc. 2010 Slide 26 http://www.Intertech.com | 800-866-9884
  27. 27.  WCF also has a number of useful updates.  Many of these updates are very (very) specific to particular bindings or WS-* specifications.  Consult the .NET 4.0 documentation for a list of the “minor” features. Here, I’d like to point out some Simplifications made to host / client Configuration files. Copyright © Intertech, Inc. 2010 Slide 27 http://www.Intertech.com | 800-866-9884
  28. 28.  Under .NET 3.5, if you call Open() on the ServiceHost object, and have not yet specified at least one endpoint, the runtime will thrown an exception.  This endpoint can be supplied via code or configuration.  However, with the release of .NET 4.0, every WCF service is automatically provided with "default endpoints" that capture commonplace configuration details for each supported protocol. <system.serviceModel> ... <protocolMapping> <add scheme="http" binding="basicHttpBinding"/> <add scheme="net.tcp" binding="netTcpBinding"/> The .NET 4.0 config file <add scheme="net.pipe" binding="netNamedPipeBinding"/> Now defines common <add scheme="net.msmq" binding="netMsmqBinding"/> Protocol mappings. </protocolMapping> ... </system.serviceModel> Copyright © Intertech, Inc. 2010 Slide 28 http://www.Intertech.com | 800-866-9884
  29. 29.  The following host config file exposes a service using HTTP and TCP bindings.  Again, notice we do *not* need to specify endpoint elements! <configuration> <system.serviceModel> <services> <service name="MagicEightBallServiceLib.MagicEightBallService" > <host> <baseAddresses> <add baseAddress="http://localhost:8080/MagicEightBallService"/> <add baseAddress= "net.tcp://localhost:8099/MagicEightBallService"/> </baseAddresses> </host> </service> </services> </system.serviceModel> </configuration> Copyright © Intertech, Inc. 2010 Slide 29 http://www.Intertech.com | 800-866-9884
  30. 30.  It is also possible to change <configuration> <system.serviceModel> default values to an auto- <services> endpoint. <service name="MagicEightBallServiceLib.MagicEightBallService" > <host>  However if you are leveraging a <baseAddresses> <add baseAddress="http://localhost:8080/MagicEightBallService"/> default endpoint, we can't <add baseAddress= connect the <binding> to the "net.tcp://localhost:8099/MagicEightBallService"/> <endpoint>! </baseAddresses> </host>  As luck would have it, we can </service> control the settings of a default </services> endpoint simply by omitting the name attribute of the <bindings> <basicHttpBinding> <binding> element. <binding openTimeout = "00:00:30" /> </basicHttpBinding> <netTcpBinding> <binding closeTimeout="00:00:15"/> </netTcpBinding> </bindings> </system.serviceModel> </configuration> Copyright © Intertech, Inc. 2010 Slide 30 http://www.Intertech.com | 800-866-9884
  31. 31.  The most useful <configuration> <system.serviceModel> shortcut is out-of-the- <services> <service name="MagicEightBallServiceLib.MagicEightBallService" > box MEX support. <host> <baseAddresses> <add baseAddress="http://localhost:8080/MagicEightBallService"/>  The trick is that the <add baseAddress= <serviceMetadata> "net.tcp://localhost:8099/MagicEightBallService"/> </baseAddresses> element no longer has </host> </service> a name attribute (and </services> <bindings> also notice the <basicHttpBinding> <service> element no <binding openTimeout = "00:00:30" /> </basicHttpBinding> longer needs the <netTcpBinding> <binding closeTimeout="00:00:15"/> behaviorConfiguration </netTcpBinding> </bindings> attribute). <behaviors> <serviceBehaviors>  With this adjustment, we <behavior> get free MEX support at <!-- To get default MEX, don't name your <serviceMetadata> element--> <serviceMetadata httpGetEnabled="true"/> runtime. </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration> Copyright © Intertech, Inc. 2010 Slide 31 http://www.Intertech.com | 800-866-9884
  32. 32.  The first release of the WF API took place with .NET 3.0  Using WF programmers are able to model business processes in their assemblies, using a collection of "activities".  One benefit of WF is that the integrated designers serve as a living document for the business process itself. This can be easily described to non-programming staff.  As well, WF provides a set of runtime support to monitor a business process, including transaction management, persistence of long running processes, tracking support and so forth.  As intriguing a technology as the first release of WF was, it was not without its warts.  A number of developers felt the designer experience provided by Visual Studio 2008 was lackluster, and it was too cumbersome to navigate complex workflow during development.  As well, the initial release of WF required a good deal of boilerplate code to get a workflow up and running, and even the act of building the workflow itself was a bit clunky.  As well, a C# code base and the related workflow designer representation did not mesh together as seamlessly as hoped. Copyright © Intertech, Inc. 2010 Slide 32 http://www.Intertech.com | 800-866-9884
  33. 33.  .NET 4.0 gives us a complete reboot of the entire WF API.  Going forward, workflows are modeled (by default) using a declarative XML based grammar named XAML where data used by the workflow is treated as a first class citizen.  As well, the Visual Studio 2010 WF designers have been completely overhauled and rewritten using WPF technologies.  So, if you used the previous version of the WF API and were a tad dissatisfied, I encourage you to read on with a fresh set of eyes.  Unlike 3.5 WF applications, you define your workflow entirely in XAML.  Unlike WPF XAML, WF XAML does support a syntax for embedding code within markup.  As well, you will use XAML to define workflow data variables, argument variables and even which namespaces you wish to import into your project. Copyright © Intertech, Inc. 2010 Slide 33 http://www.Intertech.com | 800-866-9884
  34. 34.  Assume you have placed a WriteLine activity on your designer.  Notice that while you are configuring an activity, you can invoke methods or properties on an object. <Activity ...> <WriteLine sad:XamlDebuggerXmlReader.FileName= "C:WorkflowConsoleApplication1Workflow1.xaml" sap:VirtualizedContainerService.HintSize="211,200" Text="[&quot;Hello&quot;.Length.ToString()]" /> </Activity> Copyright © Intertech, Inc. 2010 Slide 34 http://www.Intertech.com | 800-866-9884
  35. 35.  Once you have created your workflow, you are able to pass in an instance to the WF runtime using the WorkflowInvoker.  This is a light weight class which allows you to start a workflow with a single line of code in a synchronous manner. class Program { static void Main(string[] args) { WorkflowInvoker.Invoke(new Workflow1()); } } Copyright © Intertech, Inc. 2010 Slide 35 http://www.Intertech.com | 800-866-9884
  36. 36.  A workflow can be static void Main(string[] args) { executed in an // Used to inform primary thread to wait! AutoResetEvent waitHandle = new AutoResetEvent(false); asynchronous manner using the // Create workflow app. WorkflowApplication app = WorkflowApplication new WorkflowApplication(new Workflow1()); type. // Hook up an event with this app.  Consider the example // When we are done, notify other thread we are done, // and print a message. below, which hooks app.Completed = (completedArgs) => { into a few events waitHandle.Set(); Console.WriteLine("The workflow is done!"); during the callback }; process. // Start the workflow! app.Run(); // Wait until we are notified the workflow is done. waitHandle.WaitOne(); Demo! Console.WriteLine("Thanks for playing"); } Copyright © Intertech, Inc. 2010 Slide 36 http://www.Intertech.com | 800-866-9884
  37. 37.  To summarize the changes we have looked at in this presentation:  C# now supports optional/named arguments & dynamic data.  VB now supports automatic properties, collection initialization and proper lambdas.  The TPL/PLINQ APIs provide a new (and easier) way to incorporate multithreaded functionality into your applications.  WPF now supports a new VSM to simplify the construction of control templates.  WCF now supports a simplified configuration file schema.  WF is 100% different from the 3.5 WF API.  Please feel free to contact me if you have any questions:  atroelsen@intertech.com Copyright © Intertech, Inc. 2010 Slide 37 http://www.Intertech.com | 800-866-9884
  38. 38. http://itunes.intertech.com http://linkedin.intertech.com http://facebook.intertech.com http://twitter.intertech.com http://youtube.intertech.com http://www.Intertech.com/Blog Copyright © Intertech, Inc. 2010 Slide 38 http://www.Intertech.com | 800-866-9884
  39. 39.  Founded in 1991, Intertech offers a full training line-up:  JEE, open source technologies  .NET, SQL Server, SharePoint  XML, Ajax  Delivery formats include:  Instructor-led public and onsite  Instructor-led night and virtual  Self-paced study  For advanced purchase customers, Intertech offers Elite Rewards™— call 651-994-8558 +23 Copyright © Intertech, Inc. 2010 Slide 39 http://www.Intertech.com | 800-866-9884
  40. 40.  In addition to training, Intertech delivers consulting  Consulting is part of our brand: Instructors Who Consult | Consultants Who Teach  Give your project success with our consulting services  To learn more, contact us at 651-994-8558 +11 Copyright © Intertech, Inc. 2010 Slide 40 http://www.Intertech.com | 800-866-9884

×