Tim Murphy's .NET Software Architecture Blog

Development

Starting An Umbraco Project

As I have been documenting Umbraco development I realized that people need a starting point. This post will cover how to start an Umbraco project using an approach suitable for ALM development processes. The criteria I feel a maintainable solution include are a customizable development project which can be easily in source control with a robust and replicatable database. Of course this has to fall within the options available with Umbraco. For mean this means an ASP.NET web application and a SQL ......

Relating Umbraco Content With the Content Picker

After addressing Umbraco team development in my previous post I want to explore maintaining relationships between pieces of content in Umbraco and accessing them programmatically here. For those of us who have a natural tendency to think of data entities and their relationships working within a CMS hierarchy can be challenging. Add to that the fact that users don’t only want to query within that hierarchy and things get even more challenging. Fortunately we will see here that adding the Content Picker ......

Umbraco Team Development

The Umbraco CMS platform give you the ability to create a content managed site with the familiar development process of ASP.NET MVC. If you are the only developer things don’t get too complicated, but the moment you are sharing your solution with a team you gain a few wrinkles that have to be addressed. Syncing Content and Document Types Umbraco saves its content partially to the file system and partially to the database. This complicates sharing document types, templates and content between developers. ......

Query Application Insights REST API To Create Custom Notifications

Application Insights is one of those tools that has been around for a number of years now, but is finally getting understood as more companies move to Azure as a cloud solution. It has become an amazing tool for monitoring the performance of your application, but it can also work as a general logging platform as I have posted before. Now that you are capturing all this information how can you leverage it? Going to the Azure portal whenever you want an answer is time consuming. It would be great if ......

Logging To Application Insights In Azure Functions

In my last post I covered logging in Azure Functions using TraceWriter and log4net. Both of these work, but Application Insights rolls all your monitoring into one solution, from metrics to tracking messages. I have also heard a rumor that in the near future this will be an integrated part of Azure Functions. Given these factors it seem wise to start give it a closer look. So how do you take advantage of them right now? If you go to GitHub there is a sample written by Christopher Anderson, but let ......

Application Integration: Azure Functions Vs WebJobs

[Updated]UI development gets all the attention, but application integration is where the real work is done. When it comes to application integration in the Azure ecosystem you better learn how Functions and WebJobs are developed and under what conditions you should use each. In this post I will try to answer those questions. For me it is important that a solutions is reasonably maintainable, deployable through environments and can be easily managed under source control. Both products are built on ......

Local LINQtoSQL Database For Your Windows Phone 7 Application

There aren’t many applications that are of value without having some for of data store. In Windows Phone development we have a few options. You can store text directly to isolated storage. You can also use a number of third party libraries to create or mimic databases in isolated storage. With Mango we gained the ability to have a native .NET database approach which uses LINQ to SQL. In this article I will try to bring together the components needed to implement this last type of data store and fill ......

Using BingMapsDirectionsTask In Windows Phone 7

Windows Phone has a number of great capabilities built into it for developers. The Bing APIs allows you to easily give your application mapping functionality. You may just want to give users directions to a fixed location. What happens though when you want to give a user directions from their current location to an address that they are picking from application data? This article will cover just that scenario. Since almost everything in Windows Phone development is asynchronous this can get a little ......

Reading QR Codes In Your Windows Phone App

I have recently been working on an application for a client that needs to read QR codes. This has lead to some interesting findings. There are a couple of approaches you can use. One is to take a picture and evaluate it for a code and the other is more like the Bing Vision feature. Both of them can be accomplished by leveraging theSilverlight ZXing library from Codeplex. In order to have QR code images to test I would suggest going to QRStuff.com. It is a site where you can freely generate QR images ......

Implementing Logging In Azure Functions

Logging is essential to the support of any piece of code. In this post I will cover two approaches to logging in Azure Functions: TraceWriter and log4net. TraceWriter The TraceWriter that is available out of the box with Azure Functions is a good starting point. Unfortunately it is short lived and only 1000 messages are kept at a maximum and at most they are held in file form for two days. That being said, I would not skip using the TraceWriter. Your function will have a TraceWriter object passed ......

Building Azure Functions: Part 3 – Coding Concerns

In this third part of my series on Azure Function development I will cover a number of development concepts and concerns. These are just some of the basics. You can look for more posts coming in the future that will cover specific topics in more detail. General Development One of the first things you will have to get used to is developing in a very stateless manner. Any other .NET application type has a class at its base. Functions, on the other hand, are just what they say, a method that runs within ......

Pay It Forward

One of my hobbies is photography (webshots, zooomr) and I was listening to The Digital Photography Show podcast where the guest was Kevin Kubota. He presents photography seminars and is offering scholarships to his seminars. The interesting part of the application is that you have to describe what charity work you do. He said that he figures if he is doing something for you then you should be doing something for your community to show that you are serious. So how does this relate to architecture ......

Building Azure Functions: Part 2–Settings And References

This is the second post in a series on building Azure Functions. In this post I’ll continue by describing how to add settings to your function and reference different assemblies to give you more capabilities. Settings Functions do not have configuration files so you must add app settings and connection strings through the settings page. The settings are maintained at an Function App level and not individual functions. While this allows you to share common configuration values it means that if your ......

Building Azure Functions: Part 1–Creating and Binding

The latest buzz word is serverless applications. Azure Functions are Microsoft’s offering in this space. As with most products that are new on the cloud Azure Functions are still evolving and therefore can be challenging to develop. Documentation is still being worked on at the time I am writing this so here are some things that I have learned while implementing them. There is a lot to cover here so I am going to break this topic into a few posts: Creating and Binding Settings and References Coding ......

A TFS Developer In A GitHub World

Git and GitHub have been around for a few years now. They are becoming more popular by the day. I finally got around to looking at them more closely over the last few months and decided to summarize the experiences. My first experience with GitHub was not the most pleasant. I was using Visual Studio 2013 which doesn’t seem to have the best integration story (or at least didn’t when I tried it). The fact that it required that an existing repository be cloned via the GitHub desktop before Visual Studio ......

Increase Cloud Application Responsiveness With Azure Queues and WebJobs

This post is based on the presentation I gave at Cloud Saturday Chicago. In a mobile first world services need to be able to process high volumes of traffic as quickly as possible. With the certification and deployment process which native mobile apps have to go through being long and sometimes uncertain, we find ourselves looking for ways to make improvements without changing the device code. The flexibility of Azure and other cloud platforms gives developers the ability to easily implement changes ......

What Should Your Goals Be When Developing

This post was prompted by a number of Twitter posts that were discussing if developers thought about who would be maintaining the code they wrote. Of course the answer is “it depends” as any good consultant will tell you. No two developers are the same. Some are more aware of the consequences of their decisions than others. The real question is what should your goals be as you are developing? The main trade off we struggle with are speed to market versus maintainability. Every project is under time ......

IDEs For Developing Node.js In A Windows Environment

Node.js has become one of the most predominant JavaScript based solution frameworks over the last couple of years. As with most ideas that start in the open source community it has crept its way into the Microsoft based platforms. For those of us who make our living in the Windows ecosystem it is beneficial to know what tools are available to add Node.js components to our solution landscape. This post will briefly introduce four of the development environments to build Node.js projects on the Windows ......

BUILD 2016 Thoughts: Home Sweet Windows

It is that time of year again where Microsoft developers gather in San Francisco to hear the direction that Microsoft is moving and the tools they are offering to get us there. The big theme this year has been “Windows is home for developers”. So what did Microsoft have in store for us? How Far Have We Come There were a lot of stats that showed up during the keynotes. A couple that stood out for me were that there are currently over 270 million users on Windows 10 and that Cortana is answering over ......

Azure Application Component Deployment

One of the aspects of Azure development that I have found the least amount of information written about is the deployment of your application components. This is especially the case when it comes to ALM (Application Lifecycle Management) approaches are considered. As with most things you get the WSYWG demo, but not how things should actually be done in an enterprise environment. This post will try to cover as many deployment approaches as possible. While it won’t be comprehensive it will give you ......

Creating Azure WebJobs With The WebJobs SDK

The move to the cloud of many applications means that we have to learn new approaches to solving old problems. One common problem that most developers face at one point or another is background processing for web sites. In the past the solution would have often been to build a Windows Service and install it on a machine. Of course if you are using Azure Web Sites to host you application you do not have access to install services. Depending on what you need to accomplish WebJobs are the solution. ......

Rejuvenate Your Career

We can all get in a rut after years in this industry. We get comfortable doing what we know. The problem is that technology does not stand still. If we don’t keep reinventing ourselves then we will eventually find that we don’t have the skills that the industry requires. This is so important an issue that I often ask prospective employment candidates how they keep up with technology. So what is my answer to rejuvenate your career? Because I spend most of my time developing solutions for the Microsoft ......

Teaching Old Dogs New Tricks

Old developers can easily get set in their ways especially if they work in one environment for a dozen years or more. So how do you overcome the “that is the way it has always been done” mentality that sets in? The first thing you have to do is be patient. Don’t try to force them to change all at once. Too much change at one time can be a shock to anyone’s system. Gradually introduce new ideas and new techniques. The next thing you need to do is to make sure that you demonstrate examples and explain ......

Getting Started With WiX

Up until this week I had not even heard of WiX (Windows Installer XML Tools). As with most open source projects I found myself spending a large amount of time trying to find resources to explain how to use this tool. I figured if I was struggling there might be a few others that could use some help. In this post I will cover a number of topics to get you started with WiX. First thing you need is the toolset itself. You can get it here. Once you run the install be sure to restart your machine so that ......

Enhancing Your Model In MVC 5

Simple views in ASP.NET MVC 5 are simple, but once you start getting a lot of conditional content formatting in the view things can get very messy. Once you get to the point where your Razor code has way to many if/else blocks and they start repeating you have to come up with a way to abstract and simplify your code. I looked at functions and partial views as possible solutions. Both of these have their place but an alternative that you may want to entertain is implementing your model as more than ......

Project Spark Maze Making Technique

When I first started creating Project Spark worlds I would try to build a mountain and then tunnel through it to create halls and rooms. This really became a test of patients. Once you have created a narrow space with ceilings it is hard to get your camera in the right place to know which direction your tunnels are heading, how close you are to the outside of your terrain and good luck placing props. The solution is actually pretty simple. Use the Add tool with the cube brush and make your corridors ......

Project Spark Development On Windows 8 With A XBox Controller

As you may have noticed, I really enjoy building Project Spark games. Until recently you have only been able to create them on Windows 8.1. Now you have the option of playing Project Spark on XBox One with XBox 360 coming in the future. While I don’t have an XBox I have realized that there are just some things that you can’t do without a controller. The biggest one for me is manipulating the size of trigger zones around props. In order to gain this capability I picked up a second hand controller ......

Presenting Project Spark At Chicago Code Camp

It is conference time again and this year I am speaking at the Chicago Code Camp on my latest addiction: Project Spark. This is the game that is currently in beta on Windows 8 and XBox One which doubles as a game development environment. Come and see how you can enjoy this and even spend more time with your kids and subliminally teach them how to code. Register at the link below. http://www.chicagocodecamp.... ......

Project Spark Beta Impressions

Many kids are addicted to Minecraft. It is a game that allows you to build the environment you play in and even create new content if you are willing to learn how to make mods. Project Spark is an offering from Microsoft which allows you to create and play top quality games. For the last couple of weeks I have been addicted to the beta of Project Spark and working with my boys to make some games. Even though it is still in beta there are some great features. It would take a tome to cover them all, ......

Windows Phone App Studio: The Social Developer Tool

Creating mobile applications is challenging, but Microsoft just made it easy for most people to create their own Windows Phone apps. People talk about Indie gaming. The Windows Phone App Studio allows people to create apps to share with their family and friends (as long as they have an App Studio account) using a WYSWYG style web site. Whether you want an app for your kid’s team, an app that introduces your company or an app for an upcoming event the App Studio can allow you to build them on your ......

How Can Project Spark Inspire Young Developers

At the BUILD conference last week there was a demonstration of Project Spark at the end of the first day’s keynote. I was amazed and inspired by the possibilities presented by this game/development environment. The inspiration came from the fact that it could teach a new generation of Minecraft hooked kids to program. It could grab their attention and hold it with amazing graphics and at the same time teach them the basics of writing code. From everything I have heard there is a drop in enrollment ......

Building apps that work Together

Writing apps that stand alone will only get yon so far. If your app can allow the user to leverage other applications and share data you Can have a real winner on your hands. Jake Sabulsky started off by explaining that you should be concentrating on the core functionality of your app and letting the framework take care of the features that users require these days. This is implemented be leveraging contracts. When Windows 8 was released it included the File, Share and Pickers contracts. With the ......

BUILD 2013 Session–Alive With Activity

Live tiles are what really add a ton of value to both Windows 8 and Windows Phone. As a developer it is important that you leverage this capability in order to make your apps more informative and give your users a reason to keep opening the app to find out details hinted at by tile updates. In this session Kraig Brockschmidt cover a wide array of dos and don’ts for implementing live tiles. I was actually worried whether I would get much out of this session when Kraig started it off with the fact ......

BUILD 2013 Session–What’s New In XAML

If ever there was a session that you felt like your head was going to explode, this one would do it. Tim Heuer proceeded to try to fit as many of the changes and additions to XAML as he could in one hour. There were a number of improvements that struck me. The first was the fact that we no longer need to put stack panels in the AppBar in order to add buttons. This has been changed to a CommandBar which at the very least makes the markup read more cleanly. Now if they would just bring this same improvement ......

What Software Architects Can Learn From Baseball Teams

My friend Larry Calrkin did a whole series on Architecture by Baseball, but after going to a recent White Sox game I got to thinking about the how baseball mirrors my experience. For me it boils down to specialization, team work and leadership. Every team member has their specialty. Infielders have great reactions and throwing accuracy. Outfielders can cover distance quickly and throw long distances. There are starting pitchers who have great control and endurance and closers who throw nasty pitches ......

Cookie Cutter Versus Custom Development

I recently had a potential client ask for an estimate of some work they wanted done. They already had a price in mind which I was pretty sure I couldn’t come close to. The reason for this is because they were comparing off the shelf, commodity type development to the custom development that it would require for my team to do the work. So does this mean that custom development can’t be the right answer if a subject area has commoditized? Not in the least. In many cases (but not all) these quick solutions ......

Reviewing Your Own Work

I am currently checking some code that I had written to be published. The process has put an exclamation point on the importance of code reviews for me. The parallels between reviewing the text, structure and examples in the book and the organization and coding structures of an application really struck home. Sometimes you just need to walk away from what you are working on for a while. You may come back an wonder what the heck was I doing. I found places that I had been writing while coding and ......

Beginning PHP On Windows 8

It is always interesting to find out what technology I will have to work with next. One of the latest that I’ve had to learn is PHP and since I am running Windows 8 I had to get it working in that environment. At first I tried just downloading the Apache server files and running that, but then you have to deal with possible collisions between Apache and IIS. In the end I found out that it is easier to setup PHP for IIS. The first thing you need to make sure that the IIS feature installed. Then you ......

Leveraging Generation App

Generation App is the place for developers to get started building solutions on the latest Microsoft technologies. I originally understood it to be for Windows 8 and Windows Phone 8 development, but you can sign up for a 30 day adventure to build web apps and framework based apps as well. When you sign up you get a list of subject areas to study in order to create the best application possible. You also get daily emails with links to content to help you progress and helpful YouTube videos. The real ......

Scratch–Programming For Kids Or Going Old School

I was watching the TED session on Scratch after seeing it linked to in the DZone newsletter. I was interested to find out what it was and see if my kids might be interested in playing with it. Of course I also needed to find a new programming language to learn for the year (ok, couldn’t resist a little dry humor). The Scratch programming environment can be downloaded from MIT’s site here if you want to give it a try. Scratch is an interesting little drag-n-drop language that is great for understanding ......

Learn A New Programming Language Every Year?

I heard someone mention the other day that they have forgotten more programming languages than most developers have learned and it made me remember all the suggestions to learn a new language every year. I have probably even made this suggestion before. As I thought about it I realized that it isn’t important for it to be a language that your learn, it is just important that you learn something new. Experiment with a new platform, study data theory, join the enemy’s camp and understand their point ......

Key Windows Phone Development Concepts

As I am doing more development in and out of the enterprise arena for Windows Phone I decide I would study for the 70-599 test. I generally take certification tests as a way to force me to dig deeper into a technology. Between the development and studying I decided it would be good to put a post together of key development features in Windows Phone 7 environment. Contrary to popular belief the launch of Windows Phone 8 will not obsolete Windows Phone 7 development. With the launch of 7.8 coming shortly ......

Review: TypeMock Isolator 7

I was recently given an opportunity to review the TypeMock Isolator v7 framework. This is a very feature rich add-in for Visual Studio which simplifies unit testing by putting all the features you need right at your finger tips. Below is an abbreviated list of features found in the product. Components AutoRunner Failed Test Analyzer Coverage Test Auto-Complete The biggest productivity feature is the unit testing dashboard which drops down from the top of your Visual Studio code window. It provides ......

Windows Phone 8 Announcement

As if the Surface announcement on Monday wasn’t exciting enough, today Microsoft announce that Windows Phone 8 will be coming this fall. That itself is great news, but the features coming were like confetti flying in all different directions. Given this speed I couldn’t capture every feature they covered. A summary of what I did capture is listed below starting with their eight main features. Common Core The first thing that they covered is that Windows Phone 8 will share a core OS with Windows 8. ......

Document Your APIs

I have been working on a Windows Phone application for the user group that I help to run and have been experiencing head ache after head ache. The problem isn’t the Windows Phone development itself. The issues are with the external web service APIs that I am trying to use for sites like SlideShare and Box.net. The main issue is that while there is a lot of documentation and examples for the output of the APIs, the input format is sketchy at best. The web service for SlideShare, for example, requires ......

Implementing Team Foundation Server 2010 In A Mixed Development Environment

Most of us spend our time in Visual Studio writing .NET code within a Visual Studio solution. Given this situation we find it very easy to integrate with Team Foundation Server for our source control and have a well known work pattern. But what happens when you want to use TFS as source control for non-Microsoft development? The most important thing to remember is that source control should be as transparent as possible to the developer. If the particular language or product does not have an Integrated ......

Wire Framing WP7 Apps With Cacoo

While looking for a free alternative to Sketchflow I landed on the Cacoo web site. Any developer who decides to use the free Visual Studio tools may find themselves doing the same search. The base functionality of Cacoo is free although there are certain features that have fees attached to them such as extended stencils and templates. Cacoo doesn’t seem to have a template for WP7. It does have templates for iOS and Android development so I started with the Android template and started modidfying ......

Ways To Pass Time On Window Phone – TouchDevelop

A co-worker was showing me an in phone scripting environment on the iPhone and I knew I had seen one mentioned for the Windows Phone before. TouchDevelop is an app from Microsoft Research that allows you to create small applications that do a wide variety of operations including using most of the capabilities of the device. So could this be a fun way for us geeks to waste some time while waiting for our oil to be change or a table to open up at your favorite restaurant? So what does this language ......

Using JSON.NET To Load Twitter Search Results In WP7

The main way that Twitter provides feeds is through JSON. Unfortunately the version of the .NET Framework that is on the phone does not include the System.Runtime.Serializatio... namespace. Rather than trying to brute force the JSON feed I have been looking into using the Newtonsoft JSON.NET library. The first thing that I ran into with JSON.NET is that the documentation is severely tilted to the serialization side with almost no mention of deserialization. This would have been my preferred approach ......

Discovering Your Project

The discovery phase of any project is both exciting and critical to the project’s success. There are several key points that you need to keep in mind as you navigate this process. The first thing you need to understand is who the players in the project are and what their motivations are for the project. Leaving out a key stakeholder in the resulting product is one of the easiest ways to doom your project to fail. The better the quality of the input you have at this early phase the better chance you ......

SharePoint Thoughts

I was listening to .NET Rocks episode #713 and it got me thinking about a number of SharePoint related topics. I have been working with SharePoint since the 2001 product came out and have watched it evolve over the years. Today SharePoint is one of the most powerful and flexible products in the market. Of course that doesn’t mean there isn’t room for improvement (a lot of improvement in fact) and with much power comes much responsibility. My main gripe these days is that you have to develop on a ......

Styling Windows Phone Silverlight Applications

If you have not developed with styles in Silverlight/XAML then it can be challenging and resources can be sparse depending on how deep you get. One thing that you need to understand is what level you can apply styles and how much they can cascade. What I am finding is that this doesn’t go to the level that we are used to in HTML and CSS. While styles can be defined at a page level if you want to share styles throughout your application they should be defined in the App.xaml file. This is of course ......

COM Interop Memory Leaks With Outlook 2007 VSTO Add-ins

Memory leaks can cause strange and unexpected behaviors in your applications. Of course in this day of managed code we don’t see it as often as we used to and many of us are getting rusty in our skill to eliminate these problems. Recently I ended up with a misbehaving Outlook 2007 add-in which resulted in time spent with Microsoft support. The first thing that came out of that was a way to detect if an Outlook 2007 is experiencing memory leaks. Below is a command line command that seems to report ......

Exploring NuGet

NuGet is a topic that I have been hearing about for a while, especially from Clark Sell. I figured it was about time to take a dive into it and see what it was all about. The description of NuGet makes it seem like magic to add dependencies to your code projects. Of course there is always an explanation for how the trick works. In this case it is by using a package and a definition of how resources should be added to your project. One of the interesting aspects of using NuGet is the UI. The fact ......

October 2011 Chicago IT Architects Group Recap

It was another engaging presentation at this month’s CITAG meeting as Joe Hummel presented functional programming and its implementation using F#. Some times it is fun to attack a mind bending problem and this was one of those times. Leaning about functional programming caused about the same brain cramps as moving from procedural to object oriented for the first time. Of course when you start to get it the effect is almost euphoric. I would suggest that if you haven’t looked into functional programming ......

Accessing Authenticated WCF Services

When you make a service available external to your corporate network sometimes SSL isn’t secure enough. If you really want to limit the users who can access a service they need to tied to credentials. One of the most common credentials to tie to is a Windows account. What if you are the consumer of these services. When you add a service reference to a Visual Studio 2010 project it does not give you a chance to set credentials. The following example is how you can apply credentials to a service reference. ......

Windows Phone Silverlight Poor Man's Double-Tap

I have seen a lot of articles about gestures but they require third party libraries or complex coding approaches. What I am going to present here isn’t strictly elegant or necessarily the best approach, but this is the way we would catch this type of event when we were still dealing with message loops. For the app that I have been working on I need to take action on the double-tap of a list item. The first question you have to ask your self is what a double-tap really is. It is in simplest terms ......

Upgrading Windows Phone Projects To SDK 7.1

Even though this is one of the simplest tips it is one of the hardest to find someone who has documented it. So instead of just telling you I am going to take a quick sidebar first. I wouldn’t want you to feel you got jipped by stopping here. One thing that happened when I finished running the Mango update on my Samsung Focus was that the apps that I was testing forced me to uninstall them. Now it turns out that this wasn’t that the SDK needed to be upgraded, but that the device had to be reregistered. ......

Laying Out Windows Phone 7 ListBoxes

A listbox can be a very boring display surface, but it doesn’t have to be. Ok, so it may never be exciting. At least we can create a more flexible output. The first element you need to learn about his the ItemTemplate which is in turn composed of a DataTemplate. As this combo implies it is bound to each item/data row. We will start organizing your base layout with a Grid control. Within the Grid you can add a RowDefintions group. A RowDefinition helps when you want components to be stacked for a ......

Creating Emails For Windows Phone 7

There are many reasons that you may want to add email capability to your Windows Phone 7 application. There are a number of ways you can communicate information out from an application. The mechanism for sending email from your WP7 application is the EmailComposeTask API. The difference between this API and the one that you would use for an ASP.NET application is that it opens a screen to allow the user to select an account to use and then creates a message which the user then has to send. This makes ......

The Power Of Windows Phone 7 Tasks

One of the things that is important to learn when you are developing any application is how it will interact with the environment it lives in. I’m not talking about simply interacting with files or database but with major resources. With WP7 there are a number of things such as the photos, browser, maps and the phone itself that your application may be concerned with. The WP7 development API includes a number of access points to give your application greater reach. These APIs can be found here. They ......

Windows Phone 7 TextBox InputScope

I originally started looking for how to make a TextBox have autocomplete capability. Strangely all the articles said that it couldn’t be done. The last thing you want is for your applications to make your users struggle entering information when every other application gives them a quicker entry method. So what is the solution? The TextBox tag has an InputScope property which if you set it to Text it builds a dictionary list as the user types. For the other InputScope types it mainly changes the ......

Handling Windows Phone 7 Back Button

When you have an application that navigates to more than one level of pages you find situations where you don’t want to go back to the previous page. Originally I was thinking that the answer was to capture the OnBackButton event and force the navigation back to the main page, but through several posts I found that this would not pass certification. Here is a link that really helped to figure out a more appropriate solution. To be a little more complete here is example code that you can use use for ......

Practical Window Phone 7 ListBox Usage

Almost every example of a Silverlight ListBox that I have found merely shows how to get data bound to it, not what to do once you get it there. What good is a ListBox that you can’t get a reference back from? The quickest practical way is to hold your original datasource and use the index of the selected item as you key back into your data. It isn’t pretty and you wouldn’t want to take this approach with large amounts of data, but then again a mobile device isn’t meant to display large amounts of ......

Windows Phone 7 Key Silverlight Page Events

Often times you want to you need to update a page when you enter it or save information automatically when you leave it. When you look through the events list on the property page you won’t find an event that occurs at those points in the page lifecycle. Intellisense is your friend in this case. The events OnNavigateTo and OnNavigateFrom can be overridden to give your application the required functionality. Below is a sample signature for OnNavigateTo. protected override void OnNavigatedTo(System.Window... ......

Browser Style Difference

I was visiting a photography blog the other day and was having a lot of trouble reading it. All of the links we blending into the background. Being color blind I was wondering if it was just me and that was the way it was intended. When I asked the site owner about it he said it was a problem with IE and didn't know how to fix it. Of course being the geek that I am I couldn't leave it at that. I pulled down the source (evidently a WordPress template) and his style sheets. Everything looked fine, ......

More Windows Phone 7 Panorama Notes

The saga goes on. There is always something more to learn. While I thought that ManipulationCompleted would do the trick from me it turned out it won’t. It turns out that if you want to figure out what PanoramaItem you are on when the user navigates between PanoramaItems the SelectionChanged event in conjunction with the SelectedItem on the Panorama works pretty well. private void Panorama_SelectionChanged(o... sender, SelectionChangedEventArgs e){ PanoramaItem item = (PanoramaItem)Panorama.Sele... ......

Windows Phone 7 Panorama Page

Creating a WP7 application with a Panorama page is fairly simple. Teaching it to do tricks is another thing altogether. As with most development controls the key is to learn the event model along with the object model. Knowing what manipulation means, when it happens and what the different levels it occurs at can be a great benefit. This was the case when I wanted to make sure that a particular item was updated before the user got to a particular PanoramaItem. The visibility of a PanoramaItem does ......

Custom SharePoint Timer and ULS

Over the last few months we have been developing custom SharePoint timer jobs. Since the jobs run under a Windows Service it makes it difficult to debug them. The saving grace we found is called ULS. It gives you a logging location that is consistent with the native timer jobs and an API which resembles most other logging frameworks. In order write events you first need to include the Microsoft.SharePoint.Admini... assembly. Then it is simply a matter of getting an instance of a SPDiagnosticsService ......

Beginning Windows Phone 7 Development

Windows Phone 7 development is an exciting topic. I have been exploring WP7 development for a little while now and I figured I would post some of the basic concepts that might be helpful to beginners. So here they are in no particular order. Panorama control I kept seeing references to the Panorama Control. It seems that this was a control that existed separately during the beta for WP7. In the final release this is now incorporated into a page type, so you won’t see the control in the toolbox. So ......

Alternate OOXML Document Generation Approach

Eric White has put out a document generation example which uses XPath and Word Content Controls. I applaud Eric for the amount of work he has done with his exploration of different ways to perform template base generation. This is a subject that is challenging and we need as many ideas as we can get. There are a couple of areas that I see room for improvement in this XPath design that I would like to bring up. The first is that Eric has chosen to put his document generation in the document itself. ......

Linq to SQL and Linq to SQL classes

While I have been using Linq to Object for a couple of years now I had not investigated Linq to SQL up to this point. I figured I would put together my take on this technology’s use. Linq is a wonderful syntax for navigating an object graph without having to walk the graph object by object and member by member. It is concise and compact but for someone who has never seen its syntax you would swear you went from reading English to obscure mathematic notation. If you want to learn about the general ......

What Is INET_ATON And Why Is It In A Database

While converting some MySql databases to SQL Server I ran across this function. Confused by the lack of hints to its purpose in the name I did what any red-blooded IT person would do… look it up. It turns out that this function turns the string representation of an IP address into a long integer. What good that does I am still not sure, but here is the jist of the operation. (octet1 * 256^3) + (octet2 * 256^2) + (octet3 * 256) + octet4 Simple enough, right? Now for the real question. What the heck ......

October 2010 Chicago Information Technology Architects Group Wrap Up

Earlier this week Mike Vogt and I presented an introduction to design patterns. While I think that all developers should understand design patterns I don’t believe you can be a good architect unless you a firm grasp of patterns at at the application, system and enterprise levels. We had some fun with the subject by alternating between .NET and Java examples. I think if we had hidden certain parts of the IDE we could have challenged the attendees to tell us which example was in C# and which was in ......

Review: Head First Design Patterns

Design patterns are an important part of understanding the best practices of software development. Head First Design Patterns is another great book in the Head First series which takes a more story based teaching approach. As you get past the format of the book there are specific things that I like about the subject matter coverage. Rather than just laying out the name, problem and solution for each of the original patterns, they compare and contrast them. In some cases they even pull in patterns ......

Creating Parent-Child Relationships in SSRS

As I have been working on SQL Server Reporting Services reports the last couple of weeks I ran into a scenario where I needed to present a parent-child data layout. It is rare that I have seen a report that was a simple tabular or matrix format and this report continued that trend. I found that the processes for developing complex SSRS reports aren’t as commonly described as I would have thought. Below I will layout the process that I went through to create a solution. I started with a List control ......

Memories Of The Past While Learning The Future

The last couple of weeks I have been working through some proof of concepts for Windows Phone 7. While working through one exercise I had a flashback. The book I was reading mentioned how you needed to code your application to have the smallest possible memory and and processing speed footprint. Suddenly I was back in high school with my Tandy hand-held computer which had a single line of text screen and a whopping 1K of memory. Talk about limitations. So what else can you learn from developing in ......

Dealing With Table Borders In OOXML

Note: Cross posted from Coding The Document. Permalink Formatting tables in a document programmatically can be a very complex task. This is the major reason which we start our document generation projects with templates instead of building components in a document by hand. Borders are on aspect of a table that you may want to fomat. Borders are used to make certain content in a table stand out. If you need to conditionally set and remove borders there is something that you need to be aware of. Even ......

Naming PowerPoint Components With A VSTO Add-In

Note: Cross posted from Coding The Document. Permalink Sometimes in order to work with Open XML we need a little help from other tools. In this post I am going to describe a fairly simple solution for marking up PowerPoint presentations so that they can be used as templates and processed using the Open XML SDK. Add-ins are tools which it can be hard to find information on. I am going to up the obscurity by adding a Ribbon button. For my example I am using Visual Studio 2008 and creating a PowerPoint ......

Bolding and Underlining Text In Word Documents

Note: Cross posted from Coding The Document. Permalink In the templates that I have processed with Open XML there are usually a number of tables. Some times we have to add an extra paragraph to a cell and we want to keep the formatting of the text already in the cell. In this post I will go over how to apply bold and underline formatting to text as well as how to steal it from existing text and apply it to a new paragraph or run. In order to apply an underline format to a paragraph by hand you have ......

Sending Email Through Lotus Notes Via SMTPClient

The topic covered in this post actually have applicability beyond Lotus Notes, but that is just where I ran into the problem. The real subject is adding credentials to your SMTP client. Normally I would just make sure that the service sending the email has permission to send email to an Exchange server. The problem I had to send the email through Lotus and it wanted a separate login from the identity running the program. The only error message I got back when I originally wrote the code without specifying ......

How Does Simple Text Markup Differ Across The Office 2007 Suite

Note: Cross posted from Coding The Document. Permalink Our theme recently is things that need to be made more consistent in the office products in order to make document generation development more efficient for developers. This time around we will focus on difference between the way text is marked up in Word and PowerPoint. I have found that there are a number of subtle but important differences in the way text is written to the Open XML standard. This is then reflected in the Open XML SDK’s API. ......

nPlus1.org ArcSummit Wrap-up

On December 7th I presented at the nPlus1.org ArcSummit. My talk was on Dependency Injection and Inversion of Control containers. Thank you to all those who attended. When we were done Chris Woodruff and I were asked to record an episode of The Thirsty Developer. It was a great experience seeing how these shows are put together and being able to just sit down and talk with Dave Bost, Clark Sell and Chris Woodruff. I’ll post again when the episode comes out. The slides for the presentation are available ......

Choosing Custom XML For Tagging In Word With OOXML

In the further adventures of OOXML we have been looking at different approaches to tagging content in a Word template to be programmatically replaced. Initially we looked at simple in-line text as a user defined tagging system. The problem is that this is very error prone. The user has to enter the tag exactly the same every time. On top of that if the user backspaces while typing the tag or spell check flags the tag then the tag will be split into multiple tags. This is less than desirable. Content ......

Retrieving A List of SdtBlocks for A Tag Value Using LINQ

If you are using a template document and replacing text programmatically using the Office Open XML SDK 2 API you will need a way to identify the target to be replaced. One option is to use a Content Control and setting the tag value the same for all of the controls that need to be substituted with a single value. After some trial and error and a lot of digging through the DocumentReflector I came up with the following LINQ query to get a list of all blocks with the same tag name. var blocks = from ......

Creating Snippets For Visual Studio

There is nothing earth shattering here. I was just putting together a set of snippets to make life a little easier while developing SharePoint and Office Open XML projects. My search for information crossed a lot of different sites. MSDN has a number of articles about all the features of creating and managing snippets. Below is a compilation of the basics around creating these little helpers. Hopefully it is a little more detailed in the whys then MSDN content. Creating A Snippet File Snippet files ......

Writing Web Parts for SharePoint 2007

SharePoint has been around for quite some time. I first worked with it in its original version in 2001. And so began a love hate relationship that has lasted these many years. Recently I have been spending a significant amount of time writing custom web parts. Below are a number of notes I have accumulated while rediscovering what SharePoint can do. I don’t claim that these are best practices, only that they have worked for me. Environment General Creating web parts for WSS 3.0 or MOSS 2007 requires ......

Random Thoughts On Software Development

I was listening to an episode of .NET Rocks in which Ted Neward spent some time discussing the direction that languages are going. This was predominantly a discussion of the DSL concepts, but the interview got me thinking about languages and how we design the internal structure of applications. One of the main things that struck me was that something about objects has never felt quite natural. I have never found a decomposition technique that I was satisfied with. Looking at objects as nouns in your ......

The Quest For Elegant Code

Why do we strive to write the most elegant and compact code? I was working on a piece of code recently that the most straight forward way to write it would be dozens of if statements with redundant lines of code. This bugged me so much that I actually spent an hour looking for a framework method to simplify the code. Of course this search blinded me from the quick solution of writing a simple helper function. So why does this bug most of us? I believe that it is the mark of good developers, analysts ......

Learning WPF

Wow! The learning curve for WPF is pretty steep. It is at least when you compare it to WinForms or ASP.NET. I guess the price you pay for flexibility is complexity. Discoverablility is definitely a problem with XAML. How do these silly tags work? Most of them don't have properties as you would expect. You have to add child tags which may or may not have properties. The children may also be extensions of the parent object. Certain tags seems like they will have an effect, such as wrapping content, ......

Quoted In Redmond Developer News

As a result of an earlier post on Krugle I got a correspondence from Michael Desmond at Redmond Developer News. The result of this got printed in the April 15, 2008 issue. Now he only picked a couple of sentences from my response, but in all I think it was pretty accurate. The one thing I would correct is that I was speaking more about the public site than the appliances that Krugle supplies, since that is what I have experience with. Either way the idea still holds true that reading other peoples ......

Do Companies Really Want To Ship Software

I was reading a blog post the other day about motivating software developers to be motivated to ship code. While I agree this is a problem I have to ask the question "do IT departments really want to ship code"? Here is where I am coming from. I have seen enough IT departments where they stack release on top of release at such a frenzied pace that it causes them to split their resources. When you have multiple versions of an application that have to be tested you need more environment that all have ......

Standing Your Ground - Doing What's Right For The Project

Many times as you go through the phases of a project you may get pressure to do a quick fix just to be able to close a phase. You may even be told others what the fix to your work should be. The question is if you are sure it is the right fix. Sometimes even though those around you are ready to roll heads some times you have to stop everything, take a step back and research if the solution on the table is right or just fast. Often the fast solutions end up generating more problems because no one ......

Creating Your Own Testing Tools

Ok, so it isn't necessarily the most efficient way to spend your time. It is usually better to buy your tools whenever possible, but it is a great way to learn. Of course I am not talking about recreating Nant or CruiseControl. What I am suggesting would be more in the nature of a test harness for integration testing purposes. These are strategic tools that will pay for themselves as you move from development into production support. One area where these harnesses come in handy are integration points ......

Bigfoot Is Two Inches Tall

File this under "take you lessons from all parts of life". Recently there has been a lot of buzz about a picture of "Bigfoot" on Mars taken by the Spirit rover. As an amateur astronomer and a skeptic this has been humorous and disturbing to watch. You have to wonder how people could actually believe that this might be a life form. We are talking about a planet with very little atmosphere and no magnetic field to protect it from cosmic radiation. If you take a look at Emily Lakdawalla's blog post ......

Risk Aversion In Software Development

Managing a software development project is always a risk versus benefit balancing act. It seems that lately the scales have tipped way over to the side of reducing risk rather than supplying benefit. What do you do when you have a problem with an application but a fix won't be allowed because there is a work around? The benefit needs to be put into terms of savings. Does the solution require regular intervention on the part of a support team or is the user delayed in their work while waiting for ......

The Power Of Krugle And Reflector

I have posted before about reading other's code. What happens when you need an example to get ideas from or to better understand usage. Let's face it. Documentation of a language doesn't always give you everything you need to know. If you haven't already found it, Krugle is a good place to look for code sample. It is the Google of code files. It has been around for a while but I don't believe that most developers know about it or use it as much as they might benefit. Try it out. Now you may want ......

Advantages Of Reading Other People's Code

Many new developers (and old developers) feel that reading other people's code is boring if not torture. I suggest that you look at this necessary evil as opportunities to discover treasures. You can learn new techniques by reviewing other's work. You can also learn things that you shouldn't do or remind yourself why you don't code a certain way. Either way you will most likely see code implemented in ways that you wouldn't normally do yourself. So lets take this discussion beyond just reading the ......

Assumptions Kill Projects

Most people have heard the old saying about assumptions. Something about making something out of you and me. Well it is true. I recently got into a crunch situation with a client and experienced this first hand. It doesn't matter if it is requirement or team responsibilities. Anything that is not recorded or communicated is a risk. I know that different methodologies have differing opinions on documentation, but in the end all of them seem to agree that communication is the key. It should be well ......

Polymorphic Podcast Firing On All Cylinders Again

I have mentioned before that one of my favorite podcasts is the Polymorphic Podcast hosted by Craig Shoemaker. Things were a little slow there for a while. I am guessing because Craig has done this because he wants to, not because he gets paid to and life just gets in the way some times. This week he is fired back up to full steam. He has a great interview with Scott Hanselman. The only unfortunate part of the show is that it is making me feel old. I am five years older than Scott and haven't done ......

Creating A Paint.NET Effect Plugin

This is an area that I have not explored before. That is the creation of plug-ins and community property. Add to that the fact that the most graphical programming I have done is frame by frame line drawing animation on an Apple II. In this case I ran into a challenge online that requested an effect that Paint.NET did not offer. My first adventure started with a version of CodeLab published by BoltBait (sorry I don't have a real name). It is a tool that launches as an effect within Paint.NET giving ......

Ultimate Tool List

He has done it again.  Scott Hanselman has come out with his 2007 Ultimate Tool List.  If you value your time check it out.

IT: The Next Generation

I was talking with a neighbor who is going to DePaul University for software engineering. Things have definitely changed since I was in college. He was working on a Java PDA app and a traffic light controller application. That is a long way from encryption programs and inventory reports. One thing that is a little scary is that he says his focus is on project management. Now maybe my thinking is outdated, but I don't believe that you can effectively manage developers without knowing how to develop ......

What If All Scripts Supported WhatIf

In a previous post I described a PowerShell script that I created for renaming image files. The other day I mistakenly put in an incorrect value for one of the command line parameters. At that point I realized that maybe my script needed the same capability that many of the PowerShell cmdlets have. It is a parameter called "whatIf". whatIf is a parameter that cmdlets with a destructive nature make available in order to allow you to verify that your script will work as you intended before committing ......

First Impressions of VS2008 Beta 2

I decided to take the time to download the latest beta of Visual Studio. Below are my impressions from initial usage. This mainly means I opened the environment and played a little. The first thing that you notice is that the IDE looks essentially the same as it did for VS2005. When you create a new project you will notice that there are now options for WPF, WCF, WF and AJAX projects. Seeing as I spend most of my time in web applications I figured that would be a good place to start. It is good to ......

Renaming Groups of Files With PowerShell

One of my hobbies is photography. Naming image files so that they are useful can take a significant amount of time. Personally I like to name them by subject and by date so that they sequence nicely in Windows Explorer. I'm sure there are hundreds of application that already have this feature, but being a geek and wanting to lean something new I decided to figure out how to perform the task in PowerShell. The first thing I needed to figure out was how to select a group of files. I found that the ......

Be A Better Developer

I have seen posts like this floating around and then the other day I listened to Hanselminutes where Scott and Carl discussed the subject. I figured my enthusiasm has been lacking lately and maybe this would be a good way to bump it up a notch. I need to find a new way to get Microsoft products to learn on. One of the clients I used to work for had been paying for my MSDN subscription. With that gone and my current company being a miser with the developer tools I need to come up with a new plan. ......

What Is A Document Worth

I have been working on a documentation improvement project for my current client. This, along with a post by Jeremy Miller got me thinking again about the worth of documentation. The client uses a predominantly waterfall methodology, but their design documentation contained very little if any detail. The argument was the same as Jeremy's for not liking to do documentation. It becomes out of date. Now the big difference here is that Jeremy is talking about agile processes in which you discover your ......

Review: Beginning Ajax with ASP.NET

First let me say thanks to Craig Shoemaker for sending me a copy of this book. Yes, I know it has been a while since it came out, but I just finally got around to going through it. In that time Craig has been working on another book and Microsoft has renamed Atlas to ASP.NET Ajax. Craig, Wally, Paul and Scott packed this text with gems, not only on Ajax, but also the technologies that it grew up from. The book covers how we got to this point. They start all the way back with JavaScript and the DOM ......

So What Is .NET Again?

As I have mentioned before I am a consultant. Add to that the fact that I have been doing software development professionally for about twelve years and that means that I am moving into higher level work. Unfortunately that means less time that I am getting my hands dirty in the code. This is a painful transition, especially for a code junkie like me. So what is the prescription to ease my discomfort. I think it is time to bury myself in some serious code learning. I figure I have a number of books ......

How Are Martial Arts Like Software Development

Around the end of high school I studied Tae Kwon Do for a short period of time. Now my oldest son is taking Goju-Shorei at the local park district which has gotten me re-interested in the subject. Aside from causing pain in my muscles which demonstrates that I'm not a teenager any more it has had another affect. It got me thinking about its similarities between martial arts and software development.

Some Notes About Mentoring

As most of us continue on our career paths we eventually end up in a position of mentoring. To be asked to take on this responsibility says that you are trusted and considered knowledgeable. There are a few things you will want to remember as you take on this role. First, allow the person you are mentoring to learn as much on their own as possible. They cannot learn to stand on their own if you are constantly spoon feeding them answers to every problem that comes up. Instead answer a question with ......

Thinking About Testing

Lately I have gotten quite an awakening to the realities of waterfall testing processes. This has come in the form of writing tests for my current client as they are preparing for a major release. So what have I learned? First, large development groups end up with large testing teams. This makes for challenges in coordinating efforts within the group. To overcome this I believe there needs to be well defined expectations and a single owner of the effort. The second thing I have learned is that such ......

Mobile Client Software Factory Podcast

Sometimes I envy Ron Jacobs. On a recent ARCast he talked with Daniel Cazzulino about the Mobile Client Software Factory. From the discussion it sounds like this guidance package greatly simplifies mobile development and I could see this being incorporated into future versions of the Compact Framework. One cool thing they discuss is that they had to rework the Object Builder components to remove the realtime reflection from the Dependency Injection pattern that it uses. The biggest surprise was that ......

Visual Studio Team Systems Resources

I have been doing some work with VSTS and ran across a few resource that I thought some people might find of interest. Microsoft Visual Studio site - http://www.microsoft.com/vi... Team Systems Rocks (a little outdated, beta timeframe videos) - http://teamsystemrocks.com/... Team Systems Virtual Lab (only give an 90 min. environment, no instructions) - http://msdn.microsoft.com/v... Professional Visual Studio 2005 Team Systems - ISBN 0764584367 MSDN Visual ......

Trouble Shooting Skills

Over my career I have worked with individuals who were problem solving challenged. Sometimes their critical thinking were in short supply. I think that mentoring is the best way to teach these skills. When a team member has a problem don't solve it for them. Ask them questions that make them solve it themselves. One of the questions that you can teach is to evaluate the resources that they have to indicate what the cause of the problem is. They should start thinking about things like the list below. ......