Previous month:
August 2011
Next month:
October 2011

September 2011

.NET User Group Austria–20. September 2011

Die .NET User Group Austria öffnet wieder! Der nächste Termin ist schon am 20. September 2011!

Einladung zur .NET User Group Austria
Dienstag, 20. September 2011
.NET User Group Austria
Location:
Global Knowledge
Gutheil Schoder Gasse 7a, 1101 Wien
Bitte um Anmeldung: ug@christiannagel.com
oder hier: http://www.facebook.com/#!/event.php?eid=216030075117590

17:30 Zusammenkunft und Diskussionen
18:00 Präsentation von Christian Nagel zu Windows Azure Storage und neues zu Windows 8

Windows Azure Storage

Speichern von Daten im File-System, Kopieren von SQL-Express-Datenbanken in den Computing Account? Bei Windows Azure müssen die Daten anders behandelt werden. Dabei gibt es auch zahlreiche Möglichkeiten wie SQL Azure, Queues, Tables, Blobs. In dieser Session sehen Sie die Möglichkeiten für Storage in der Cloud, welche wann sinnvoll sind und wie sie eingesetzt werden können.

Außerdem gibt es Infos von der Build-Konferenz mit einem Blick auf Windows 8!

Christian

CN innovation


C# Future Directions

Thursday at Windows Build Anders Hejlsberg presented the future directions of C#. The new version number of C# is 5. The major features on this version are the integration of the Windows Runtime (WinRT) and of course the already well known async and await keywords for asynchronous programming. Anders also talked about some other cool features that I’ll introduce here.

Async Programming

The preview of the async features for C# v5 are out for some time now. I’ve already shown these keywords in a blog article from last year. Deeper information on this will follow in upcoming blog articles. Anders also talked about some other cool features that I’ll introduce here.

Great news at the conference is that the WinRT API offers async versions of the API if the function needs more than 15ms. This are 10-15% of the methods of the API. These APIs only offer async versions. Functionality like file I/O, network I/O…

And async methods have a big place in the .NET Framework as well. This makes it a lot easier to write async applications. And all applications should use this! The user interface must be very very responsive.

WinRT API asynchronous methods use IAsyncOperation<T>, .NET methods Task<T>, and JavaScript promises.

Windows Runtime

The Windows Runtime is written natively. It’s a new version of COM. Using namespaces, classes, constructors, statics, events… Using it from  C# feels very natural. Although it’s implemented natively it nearly cannot be differentiated from C# calling into managed methods. The Windows Runtime team took a lot of features from .NET and added it to the native Windows API.

It’s similar easy to create C# types that can be used from any language making use of WinRT, e.g. JavaScript. Interop is made easy, no longer [DllImport] and COM Interop attributes. Just create a public C# type that is sealed and restricted to the types of the WinRT (or types that are mapped automatically like collection interface types). The method GetMovies() returning IAsyncOperation<IList<Movie>> can be called directly from JavaScript. For Task<T> can be easily converted to IAsyncOperation<T>.

Caller Info Attributes

C++ allows changing the code line numbers and filenames with __LINE__ and __FILE__ macros. Macros are not possible in C# and never will be. However, this feature now made it into C# by using optional parameters. The attributes CallerFilePath, CallerLineNumber, and CallerMembername can be used with optional parameters. Thus it’s easy to change the line numbers like in C++ but without Macros.

Compiler as a Service – Codename Roslyn

Looking more into the future of C#, Anders introduced the current state of compiler as a service. Scenarios that are possible with this are meta-programming, read-eval-print loops, DSL embedding, accessing the complete language object model…

Anders showed how to copy C# code and paste it as Visual Basic, and the other way around. Refactoring a data class by implementing INotifyPropertyChanged to extend the properties automatically. A C# interactive Window where code can be added on the fly including intellisense and refactoring features.

I think this to be a big changer in the features available within Visual Studio and expect a lot of extensions not only from Microsoft but also coming from the community.

A CTP will be available In four weeks from now.

Summary

To summarize the most important parts: C# deeply supports the Windows Runtime, makes async programming really easy, hybrid C#/JavaScript applications are easy to do, and a CTP for Roslyn will be available soon.

Christian

CN innovation


Use what you know, do what you’ve always imagined

The first day of the //build/windows conference ended. We’ve seen an exciting keynote from Steven Sinofski. Windows 8 really rocks. Changing the world of computing.

Indeed, Windows 8 goes new ways from a usability standpoint. From the user interface there are many similarities with Windows Phone 7, but this is only the beginning. What’s similar is the integration of different calendars, photos from different places… Windows Phone 7 is a start how touch can be used with tiles, panorama… It’s really a start with WP7. Windows 8 extends this by a huge factor. Touch becomes great new possibilities. And this for a lot of different form factors. It was great to see that many different devices with different form factors on stage running Windows 8.

The new UI makes sense with every form factor. I’m happy using it on my big TV screen, to my workplace PC, notebooks, tablets, to the mobile phone. Probably on my big TV screen I prefer using Kinect gestures or touching a remote device instead of walking to the screen and touching it. Developing programs with Visual Studio I’m sure I will use the keyboard for a long time to go instead of using touch gestures and the on-screen keyboard. However, on the developer device touch is an important factor as well. Applications will be written with touch first. It looks like keyboard and mouse gestures are coming automatically using the Windows 8 controls. I really love touch on my slate-size devices and the mobile phone.

The new Windows API – Windows Runtime (WinRT) – that’s implemented native within the operating system is the new API to get to the features of the operating system. This API doesn’t look similar to the dated Windows API but more like the .NET Framework. It looks like a cleanup of the .NET Framework.

Use what you know

Before this event there was a rumor that new Metro style applications can only be written with HTML and JavaScript. I was never afraid of not using C# and XAML with Windows 8. With Microsoft different options always have been a possibility. It’s this time as well. Metro style apps can be done with C++, C#/VB, XAML, HTML, JavaScript…

.NET, WPF, and Silverlight developers still can use XAML, C#, and Visual Basic to create Metro style apps. Maybe it’s not Silverlight and not WPF. Silverlight had the code name WPF/E – no matter how it’s named now, it’s still XAML.

C++ becomes more important than it was in the previous years with features from the new C++ standards that can be used. In the code samples I’ve also seen some C++/CLI syntax to make use of the WinRT. I need to check into this. C++ with XAML.

And of course HTML/CSS and JavaScript. The big advantage here is that there are a lot more JavaScript developers worldwide than there are .NET developers. Now all the JavaScript developers can become Windows developers, and by adding just a few lines of WinRT code the application becomes bound to Windows gets a great integration and nice features.

Do what you’ve always imagined

I don’t know if that’s what we’ve imagined to do, but Windows 8 looks like a bright way to go. In the old days of computing applications made some things possible. That’s not enough anymore. Now it’s necessary to make things easy for the user. This is where the Metro style shines. Some of the attributes that should be supported by metro style applications are fast and fluid, snap and scale, contracts for communication between applications, alive tiles… I will blog more about this later.

Windows 8 also gets an app store. Metro style applications that are installed from this store roam with the user, no matter on what system he’s logging in. The app store will also be available for old Win32 applications that then can be found more easily. For these applications the app store just offers a listing, and the store gets the advantage that immediately thousands of applications can be available.

The cloud plays an important part with Windows 8. Not only with the app store, but all application settings can be stored in the cloud. A user no longer needs to configure application settings with every system.

I’ve already tried some apps and started writing Windows 8 metro style applications on my new Samsung. It’s really exciting, the future is Metro.

More information coming soon.

Christian

CN innovation


jQuery und ASP.NET MVC Workshops

19. September und 20.-21. September gibt es in Kooperation mit Global Knowledge offene Kurse zu jQuery und ASP.NET MVC in Wien:

jQuery

Rasant erobert jQuery Web-Applikationen. jQuery ist u.a. bei Amazon, Twitter, Dell, IBM im Einsatz. Bei Microsoft Tools ist jQuery bereits Bestandteil von Web Applikations-Templates Visual Studio. Für Visual Studio wird dabei gleich integrierte Dokumentation angeboten.

Dass jQuery die Web-Welt im Sturm erobert hat auch seinen Grund. Mit jQuery geht es ein vielfaches einfacher als nur mit JavaScript Web-Seiten zu gestalten, manipulieren, und zu animieren. Und dabei ist Browser-Unabhängigkeit gleich integriert.

In diesem Workshop gibt es einen 1-Tages Einstieg zu jQuery, Selectors, DOM, Animationen, jQuery Utility Funktionen, und auch einen Einstieg in jQuery UI. Kenntnisse von JavaScript sind vorteilhaft.

ASP.NET MVC 3

ASP.NET Web Forms oder ASP.NET MVC? Nach 10 Jahren ASP.NET Web Forms ist es Zeit für eine neue Technologie, wobei ASP.NET Web Forms sicher nicht obsolete ist. Hier haben wir zwei unterschiedliche Herangehensweisen an die Programmierung von Web Applikationen. Während es bei ASP.NET Web Forms die Zielsetzung gibt dass der Entwickler Web Applikationen möglichst ähnlich zu Windows Forms programmieren können soll, Methoden und Properties von (server-seitigen) Controls verwendet die den Windows Forms controls möglichst ähnlich sind, und HTML sowie JavaScript nicht anzugreifen braucht (was sich dann aber oft doch anders herausstellt), gibt es bei ASP.NET MVC eine konträre Zielsetzung. HTML und JavaScript (siehe auch jQuery) haben in ihrer Bedeutung wieder gewonnen, mehr Kontrolle über HTML ist oft wünschenswert. Mit C# wird server-seitige Funktionalität programmiert. Mit der Struktur die von ASP.NET MVC vorgegeben wird ist es auch gleich viel einfacher Unit Tests für die Applikation zu erstellen.

In diesem 2-Tages Workshop gibt es einen Einstieg in ASP.NET MVC 3, mit Controllers, Views, Routing, Razor und vieles mehr.

Für den 19. und 20.-21. September gibt es noch ein paar freie Plätze. Bei Interesse bitte office@cninnovation.com kontaktieren.  Firmenworkshops sind natürlich auch möglich.

Christian

CN innovation

Mehr Informationen zu meinen Web-Workshops


Taking advantage of Windows 7 with Web Pages

The Windows 7 taskbar is one of the great improvements of Windows 7. Users can pin applications to the taskbar so the application is fast accessible. The application need not to run, the application is accessible with the click of a button and thus replaces the quick launch. With the task bar the application can also offer some tasks that can be accessed from the user directly, instead of starting the application first and accessing the specific feature of the application. The .NET 4 version of WPF got an improvement that integrating the application with the task bar becomes an easy task. Starting with IE9, this is also an easy task to do with Web applications as this article demonstrates.

First, I’m adding a custom icon to the Web application. This icon is shown with IE9 in the taskbar and with the address link as the following figure shows.

image

If the Web application is pinned to the taskbar, the icon is displayed on the left side as well, and the back and forward buttons are colored. There’s a way to specify the color of the back and forward buttons. If the color is not specified, the color is taken automatically from the icon.

image

The icon can be specified in the header section of the HTML page with a link to an icon as shown. The meta elements named application-name, msapplication-tooltip, msapplication-starturl, and msapplication-window are used to configure the settings for the taskbar.

<link href="/Content/Icons/favicon.ico" rel="Shortcut Icon" type="image/x-icon"/> <meta content="CN innovation" name="application-name" /> <meta content="Information about CN innovation" name="msapplication-tooltip" /> <meta content="http://www.cninnovation.com" name="msapplication-starturl" /> <meta content="width=1024;height=768" name="msapplication-window" />

Selecting the context menu of the application pinned to the taskbar you can see information about the application as well as some links for fast access as the figure below demonstrates. This is the jump list.

The icon of the application is shown in the lowest section above the unpin and close options. These options as well as the menu to start in private browsing cannot be changed with IE9. The name of the application that was set with the application-name meta tag is shown beside the icon. With the application here I’ve also added two tasks for fast access which are Training and Books, and a custom section that lists the latest blog entries. How this is done is shown next.

image

Adding tasks to the task list is just a matter of adding meta tags msapplication-task. The content of this tag lists the name that is shown in the jump list, the link that should be opened on activating the item, and the icon.

<meta content="name=Training;action-uri=http://www.cninnovation.com/Home/Training;icon-uri=/Content/Icons/training.ico" name="msapplication-task" /> <meta content="name=Books;action-uri=http://www.cninnovation.com/Home/Books;icon-uri=/Content/Icons/books.ico" name="msapplication-task" />

The items that should appear above the task list can have custom section names. I’ve created a Blog section and display titles of the last five blog entries that link to these. Adding such items to the jump list is done with JavaScript. First it is verified if the Window is pinned. This can be done with the function window.external.msIsSiteMode. If it is not, and if the site is opened from a different browser, the script doesn’t need to run. A new section is created with the function msSiteModeCreateJumpList. Items to the jump list are added with msSiteModeAddJumpListItem. The parameters of this method are the name that should be displayed with the jump list, the URL that should be opened, and the link to the icon that should be displayed.

<script type="text/javascript"> try { if (window.external.msIsSiteMode()) { ext = window.external; ext.msSiteModeClearJumpList(); ext.msSiteModeCreateJumpList("Blog"); ext.msSiteModeAddJumpListItem("Sharing Assemblies between Silverlight and .NET", "http://weblogs.thinktecture.com/cnagel/2011/07/sharing-assemblies-between-silverlight-and-net.html", "/Content/Icons/blog.ico"); ext.msSiteModeAddJumpListItem("Real World .NET 4 and C#", "http://weblogs.thinktecture.com/cnagel/2011/08/real-world-net-4-and-c.html", "/Content/Icons/blog.ico"); ext.msSiteModeAddJumpListItem("BASTA! 2011 in Mainz", "http://weblogs.thinktecture.com/cnagel/2011/08/basta-2011-in-mainz.html", "/Content/Icons/blog.ico"); ext.msSiteModeAddJumpListItem("WPF ListBox Postioning using a Canvas", "http://weblogs.thinktecture.com/cnagel/2011/08/wpf-listbox-postioning-using-a-canvas.html", "/Content/Icons/blog.ico"); ext.msSiteModeAddJumpListItem("Reserve the date! Developer Day 2011", "http://weblogs.thinktecture.com/cnagel/2011/09/reserve-the-date-developer-day-2011.html", "/Content/Icons/blog.ico"); ext.msSiteModeShowJumpList(); } } catch (exception) { } </script>
In my site the JavaScript function is created dynamically by using server-side ASP.NET code to create items that reference the last five blog entries.

It will be interesting to see what features Web applications will get from Windows 8. This taskbar feature from Windows 7 is limited in the way that there is not enough place for all my important applications. Let’s see how Windows 8 changes this using Metro, and what other features Web applications can use from Windows 8.

Christian

CN innovation

How to use WPF 4 to integrate in the Windows 7 taskbar is shown in my book Professional C# 4 and .NET 4.

Information on programming Web applications in my Web programming workshop.


Reserve the date! Developer Day 2011

Bereits zum fünften mal findet heuer der Developer Day 2011 statt. Diesmal gibt es einen November-Termin, gerade rechtzeitig um über Entwicklungen von der Build-Konferenz zu berichten.

Wie die letzten Jahre werden wieder 2 Tracks parallel zur Verfügung stehen. In einem Track gibt es Tips und Tricks, Informationen zu aktuellen Technologien, wie z.B. Silverlight, Windows Azure, JQuery, ASP.NET MVC und mehr.

Der 2. Track steht im Schwerpunkt zu Windows 8 und dem neuen Application-Modell Jupiter. Informationen zu den Sessions gibt es klarerweise erst nach der BUILD Windows Konferenz.

Speaker sind u.a. Mario Szpuszta, Max Knor und Christian Nagel.

Termin schon jetzt reservieren!

Dienstag, 29. November 2011 in Wien

Wenn Du/Sie per Email Informationen zu diesem Event bekommen wollen, bitte einen Email Request schicken!

Christian

CN innovation