Tim Murphy's .NET Software Architecture Blog

January 2012 Entries

PSC Group Releases Project Risk Profiler Windows Phone Application

PSC Group is proud to announce that the Windows Phone version of its Project Risk Profiler application is now available in the Marketplace.  This application allows project managers and stakeholders to evaluate the high level risks and benefits associated with proposed project before committing to it. 

The application is based on a methodology used by PSC when initiating projects and is a port of the iPhone version of the application.  Each negative and positive attribute of a project is given a raking value.  Once all the attributes are totaled the negative total is subtracted from the positive total in order to give the project an overall score.  The lower the score the more risk there is to the project and the more caution should be exercised in deciding to the the project on.

The main features of the application allow you to create a new projection evaluation, maintain your list of projects and email the evaluation results to stakeholders.  Below are some screen shots of the application which can be found in the marketplace here.


Changing Team Foundation Server 2010 Workspace Mappings

When you place a Visual Studio solution into TFS or pull it down for the first time a default working path is set in the workspace mappings.  There are times when you need to point source code to a new location.  Once option you have is to simply use the Manage Workspaces dialog to edit the local folder for the your solution.

Select your workspace.


Click on the Local Folder and an ellipse button will appear to allow to set a new folder.


The problem with this approach is that it doesn’t seem to consistently cascade to all the child items.  The alternative is to use the Remove Mapping dialog, change the Local Folder and click the Change button.


This approach is very affective when remapping child folder locations but be aware of the fact that when you use this approach it will move the files from the original path to the new path.  If it is important that the file stay in the original location you will need to back them up first and copy them back after the remapping.  You will have to work with these options to see which works best for your situation.

February 2012 Chicago Information Technology Architects Group Presentation


So here is try number two.  Mother nature got the best of us last month with the threat of icy roads on our presentation night. Ruben Rotteveel has been gracious enough to reschedule his discussion of Advancements in Messaging Technologies for this month.  Assuming we do not get our usual February blizzard on that day it would be great to see as many of you there as possible. Be sure to register to joins us.


Twitter Search JSON Deserialization

In a previous post I talked about using the JSON to LINQ features of JSON.NET.  Thanks to Bil Simser I was able to do some testing of the deserialization capabilities of this library.  The key was his hint to leverage the json2csharp web site.  Below is the C# representation of the search results for a Twitter query created by putting an example of the search result into this site. 

public class Url
public string url { get; set; }
public string expanded_url { get; set; }
public string display_url { get; set; }
public int[] indices { get; set; }

public class Entities
public Url[] urls { get; set; }

public class Metadata
public int recent_retweets { get; set; }
public string result_type { get; set; }

public class Result
public string created_at { get; set; }
public Entities entities { get; set; }
public string from_user { get; set; }
public int from_user_id { get; set; }
public string from_user_id_str { get; set; }
public object geo { get; set; }
public object id { get; set; }
public string id_str { get; set; }
public string iso_language_code { get; set; }
public Metadata metadata { get; set; }
public string profile_image_url { get; set; }
public string source { get; set; }
public string text { get; set; }
public object to_user_id { get; set; }
public object to_user_id_str { get; set; }

public class RootObject
public double completed_in { get; set; }
public long max_id { get; set; }
public string max_id_str { get; set; }
public string next_page { get; set; }
public int page { get; set; }
public string query { get; set; }
public string refresh_url { get; set; }
public Result[] results { get; set; }
public int results_per_page { get; set; }
public int since_id { get; set; }
public string since_id_str { get; set; }

So how do we use this class once it has been created?  First we need to make sure that we are referencing the Newtonsoft.Json assembly.  As with the previous example we will use the WebClient DownloadStringAsync method to call Twitter.  The main difference is the small bit of call that is in the callback function. 

In the example below I have created a JsonSerializer and then feed the Deserialize method with a new JsonTextReader and the type of the JSON message class.  Once we get to that point it is a simple act of iterating through the object graph to find the members you are interested in.

JsonSerializer serializer = new JsonSerializer();
RootObject rootObject = (RootObject)serializer.Deserialize(new JsonTextReader(new StringReader(e.Result)), typeof(RootObject));

foreach (var tweet in rootObject.results)
this.Items.Add(new TweetViewModel(tweet.profile_image_url, tweet.text));

Between the JSON.NET library and the json2csharp web site the process of adding JSON deserialization to your Windows Phone app is much simpler.  Now go and put it to good use.

January 2012 Chicago Information Technology Architects Group Presentation


This post is really late considering that there is less than a week before the event.  Fortunately this is because 2012 is starting out with tons of work to be done.  Not a bad problem to have.  This month we will have Ruben Rotteveel discussing Advancements in Messaging Technologies.  Be sure to register to joins us.