My Software Toolbox

by Bobby Cannon August 19, 2010 02:54 PM

I wanted to post what tools I have in my toolset for developing software. These are tools that I use everyday either at work or in my personal coding efforts.

Visual Studio 2010

The best IDE ever. What else needs to be said?

Resharper

Code refactoring tool that allows you to very quickly refactor, format and simple code your projects.

YourKit Profiler

This is a memory / CPU profiler. If your application has a memory leak then this tool will help you find it. I've only used it once but it worked great and it did lead me to the issue. I haven't purchased it yet but I definitely have plan to add it to my toolbox.

SVN Server

This is my choice for source control. I've used Team Foundation server and it has always been too big for our small teams. It's also a beast to keep and maintain the Team Foundation server. I use Visual SVN server and it's very easy to install, backup and maintain. Simple backup a single directory to get all your configuration.

Tortoise and Ankh SVN Client

I use two SVN clients. Tortoise integrate itself into the windows explorer. No GUI required to activate / control the SVN client. Just the file explorer and a folder. Ankh SVN client integrates into Visual Studio 2010. This allows me access to source control directly inside Visual Studio.

TeamCity

This is the Resharper guys automated build server. It's free and it works great. I have not set it up for any of my personal project but we use it at work and it's awesome. Very simple and it works. What else you need?

YouTrack 2.1

Just started using this to track software issues, bugs, and tasks. I have really been loving it so far. I'm using the 60 day evaluation then I will probable purchase it.

Tags:

Programming | Source Control

Numeric Textbox Control in WPF

by Bobby Cannon July 17, 2010 08:17 AM

I am in need of a small utility to do some testing so I decided I would write it in WPF. I'm not that familiar with WPF so I figured this would be a great little application to use to learn.

On my dialog I need an input for "Quantity". I looked for the old faithful NumbericUpDown control but it does not exist. I was sad but decided to push forward.

I placed a textbox down and started figuring out how to block non numeric values. This turned out to be completely different than I expected. Maybe my expectation where wrong. I thought I would start by using the PreviewTextInput event to ensure that the input was a number.

private void TextBoxQuantity_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
    e.Handled = !e.Text.All(Char.IsNumber);
}

This worked great... except it would not capture the space key (" "). Look as the possible input.

This would not work. I'm not entirely sure why the PreviewTextInput event is not catching the space key but we can fix this by using the PreviewKeyDown event. Let's take a look

private void TextBoxQuantity_PreviewKeyDown(object sender, KeyEventArgs e)
{
    if (e.Key == Key.Space)
    {
        e.Handled = true;
    }
}

Now the textbox will not accept the space input. At this point many would think we are done but we are not. Take a look at what happens if you "Paste" into the textbox.

Well that's no good. We cannot let the user paste text into a NumbericTextBox. We will disable the context menu (copy, cut, paste) and disable the paste command (CTRL + V).

This code will get rid of the context menu.

public MainWindow()
{
    InitializeComponent();
    TextBoxQuantity.ContextMenu = null;
}

This code will disable the paste command.

XAML

<TextBox CommandManager.PreviewExecuted="TextBoxQuantity_PreviewExecuted" />

Code

private void TextBoxQuantity_PreviewExecuted(object sender, ExecutedRoutedEventArgs e)
{
    var commandName = ((RoutedUICommand) (e.Command)).Text;
    if (commandName == "Paste")
    {
        e.Handled = true;
    }
}

This is acceptable for my small utility but I will need to figure out how to handle the accepting or rejecting of "pasted" data. It would be nice to still allow the user to paste number into the textbox.

Now we have a textbox that will only accept numeric numbers.

Tags: ,

Programming

Using the Windows Phone 7 Accent Color

by Bobby Cannon July 10, 2010 10:58 AM

Windows Phone 7 support themes that allow you to configure the color background of Dark (black) or Light (white) and a Accent color. Currently the phone will only support four colors of Orange, Blue, Red, and Green. The user will be able to select their favorite color of the four and the phone will change the mood of the phone. Below is an example of an application before and after implementing the feature.

To set the color of a TextBlock is very easy. Here is the code.

TextBlockListTitle.Foreground = new SolidColorBrush((Color) Resources["PhoneAccentColor"]);

Adding this feature to your application in specific areas will make your application feel more integrated with the Windows Phone 7 environment. The user experience goes up and the user will enjoy your application more therefore making both the user and you happy. Some may look at this at say this is just silly but user experience is very important and you should always be interesting in every little details of your application.

Tags: ,

Programming

World of Warcraft: Realm Status

by Bobby Cannon July 08, 2010 10:36 PM

Here is my first Windows Phone 7 application! I really like to play a game called World of Warcraft. I figure it would be nice to create some applications for the Windows Phone that would be able to interact with the World of Warcraft universe. My first application will display the status of all the World of Warcraft realms (servers). Let’s step thought the different parts of the application.

The Realm Status Data

First thing we have to do is get the data that stores the realm status. This application will request the realm status from the World of Warcraft realm status page. The site is located on the realm status page. At first I thought I was going to have to parse the HTML page but after some investigation I found that the page simply displays an XML file. This is great news for parsing an XML file would be easy.

Getting the XML Data File

Getting the file should be very easy and it is. However it appears the communication model of the Windows Phone 7 is leaning toward a more asynchronous model. This means it will not be as simple as just saying give me the file and I’ll wait here until you get it. We will have to request the file and we will be alerted when the file arrives. I created a FileDownloader class to assist with getting the data file. Here is the code. More...

Tags: ,

Programming | Gaming

Personal Coding Standard

by Bobby Cannon July 07, 2010 09:12 PM

So I wanted to share with the world my personal coding standard. This is the coding standard I use everyday when I develop software. More...

Tags:

Programming

Month List