Xbox 360 Retail Store Inventory Monitor #1

This post is the first in a series about my application for finding the very rare Xbox 360 on retail store shelves in the United States. It uses all three of the core WinFX technologies and demonstrates

  • how the Windows Presentation Foundation can be used to have a visceral impact on the user
  • how the Windows Communication Foundation can be used to incorporate data from diverse sources, homogenizing them
  • how the Windows Workflow Foundation can be used to synthesize the several components of a solution

 

A similar application, using the .NET Framework 2.0, but not WinFX, was released on www.untitlednet.com in January 2006. Here is screenshot of that application:

 

It examines the Web sites of the United States national electronic retailers, Best Buy and Circuit City, and Canada’s Future Shop, to determine whether their stores in the region identified by a given postal code have Xbox 360s available for sale. The ingenuity of the application is in treating the retailer’s sites as if they are Web services: applications that make information available for automated retrieval via Internet protocols. Because the sites were not designed as Web services, they are awkward to use as services: the www.unititlednet.com application has to navigate its way through the sites with a sequence of HTTP POST commands, and must parse the HTML of the sites to determine whether stock is available.

 

The only shortcoming of the www.untitlednet.com application for locating inventory of Xbox 360s is that it somewhat underestimates the magnitude of the Xbox 360 shortage. It is not enough to try to find units in a given region. If one really wants an Xbox 360, then one must search the entire country! That is what my version does: it searches for Xbox 360s at any Best Buy or Circuit City store in the United States. Its real purpose, however, is to demonstrate the capabilities of WinFX. 

 

Here is a screenshot of my Xbox 360 inventory monitor:

 

 

Stores without inventory are listed in the top left of the sole window of the application, while stores with inventory are lower down on the left. Selecting any store in either list will cause a map to be displayed in the lower part of the screen showing the area in which the selected store is located. One can toggle between the map and an aerial photograph of the region. A rotating three-dimensional cube with the Xbox logo is in the top right-hand corner and serves no purpose other than to have a visual impact on the user. You will see that the cube is truly three-dimensional in the sense that, as it rotates, a light source that is above and to the right in front of the cube will periodically cause the metallic logo on the cube to glint.

 

You can download my source code from this location. The executable is \Xb0x360InventoryViewer\bin\debug\Xbox360InventoryViewer.exe. It should just work on any English-US system that has an Internet connection and which has the February CTP release of WinFX and MSMQ properly installed. If you have problems then check that the project for building the Xbox360InventoryViewer is referencing the right version of Crossbow, as explained here. And whenever you build, don't just build, but instead rebuild, to work around an interesting quirk in how the Windows Presentation Foundation handles resources. Also, to provide for a speedier demo, I have restricted the application to only searching for Xbox360s in 12 states. You can have it search the entire U.S. by changing the value of the RegionLimit setting in Xbox360InventoryViewer.exe.config from 12 to 50. 

 

Subsequent posts in this series will walk you through the code, which is the interesting part.