systemsSystem.Transactions was introduced in .Net 2.0.  According to Jim Johnson, who was the architect on the team that created this model, one of the design goals of System.Transactions was to extend the reach of transactions beyond DBMS (Database Management Systems) by allowing creation of transactional resources. Another goal was to simplify the programming model and the interface to use transactions.

System.Transactions.TransactionScope provides an implicit programming model in which the transactions are automatically managed by the infrastructure. It provides a simple mechanism for you to specify a code block to participate in a transaction. TransactionScope reduces the complexity of code that need to use transactions and it allows existing transaction providers to be retrofitted to participate in this programming model. Nested transaction work transparently. Disparate transaction providers can participate in a transaction without increasing the complexity of your code. No wonder TransactionScope is so popular! Read More…

Microsoft announced a significant and dramatic convergence of its Windows 8.1 and Windows Phone 8.1 platforms during the Build 2014 conference.  Approximately 90% of the WinRT APIs are now converged between the two platforms. Microsoft Visual Studio 2013 Update 2 includes features that enable developers to take advantage of this platform convergence. The Universal Apps project template is one of those features.  Read More…

Model-View-ViewModel (MVVM) is a client-side design pattern. It guides the structure and design of your code to help you achieve “Separation of Concerns.”  Implementing MVVM requires a bit of a mind-shift in the way you think about the functionality of your application. It has a significant learning curve and requires some additional upfront effort to get started on the right path. But the benefits are significant:

  • Your code is easier to understand, maintain and troubleshoot.
  • You are much more productive when you leverage the frameworks’ (WPF, Silverlight, XAML, WinRT) built-in features like Data Binding, Resource Dictionaries, Dependency Properties, Routed Events, Commands, etc.
  • You can test your app’s behavior “under-the-skin,” avoiding the pitfalls and cost of testing at the UI level.
  • Your ViewModels afford testability. You can have unit test coverage allowing “Test-Driven-Development” and “Automated Regressions.”
  • Decoupling the View from the ViewModel in the way enabled by MVVM allows designers and developers to work productively in harmony.

Read More…

This article will show you how to create a custom TimeZoneInfo that incorporates AdjustmentRules for Daylight Saving Time (DST) Transitions all the way back to 1918. The backdrop for this effort is covered in my previous blog post: Beware of Daylight Saving Time Transitions in .NET. You might want to read that one first for the context.

As noted in the previous post, the System.TimeZoneInfo uses AdjustmentRules to account for DST Transitions, and the default AdjustmentRules do not incorporate all the available DST data. But it is possible to create a custom TimeZoneInfo and populate the AdjustmentRules with DST Transition data available to cover all DST transitions.

Read More…

Back in 1980, Daylight saving time (DST) started on April 27th. But calling the IsDaylightSavingTime method in System.TimeZoneInfo class for April 15, 1980 returns true. The following test fails:

  1. [TestMethod]
  2. public void DST_Started_On_April_27_1980()
  3. {
  4.     var ts = new DateTime(1980, 4, 15, 12, 0, 0);
  5.     var isDst = Utils.EasternTimeZone.IsDaylightSavingTime(ts);
  6.     Assert.IsFalse(isDst);
  7. }

Let’s do some sleuthing and get to the bottom of this.

Read More…

CensusMapper is a Windows 8 app that retrieves U.S. Census Data using the recently released Census API and displays that data on a map using Microsoft’s Bing Maps API. The application is built using XAML and C#. The intent of this version is to establish a proof of concept as well as introduce a design and user-experience direction to be explored and evolved going forward.

Upon startup, the app retrieves the population counts for each U.S. State and displays those counts in a marker positioned in the geographic middle of each state.

CensusMapper - Initial View

Read More…