July 2009 Blog Posts

Nick from ASoft continues his series of documents on some of the less well-known WHS APIs.

This new article describes the undocumented functions in the MiscUtils class which is located in HomeServerControls.dll.
This class is a handy little helper.

You can find the document here.

If you’ve been browsing the site in the last hour, you would have noticed quite a few broken images. That’s because I’ve put in a redirector to a different image upload location, so I can reduce upgrade headaches the next time I change to a new version of Subtext.

Of course, as part of the change I managed to delete the images for a number of blog posts (including one of the tutorial sections, ouch). Always check the name of the folder you’re deleting, kids.

I use Windows Live Writer to post, and I work from either my main desktop machine or my work laptop. Luckily, Windows Live Writer saves drafts as .wpost files that include all the images you’ve attached to that post. I’m saved! I thought.

Or not.

After applying Murphy’s Law, I realised the images I had lost were all from posts I made from my laptop, which has recently been wiped and rebuilt with Windows 7 RC.

But, being the smart Windows Home Server user that I am, I’d made a backup image of my laptop before upgrading to Windows 7. So, all I had to do was crack open the backup, navigate to my old My Documents folder, and copy out the relevant .wpost files.

Thanks, Windows Home Server!

Jesse over at Jesseweb.com has a post up on how to add a WHS shortcut to My Computer, to expose all sorts of nifty functionality in a right-click menu.

To do this, you simply need to add some registry values and have an icon to display.  I have created an "Application" I call "AspireHome My Computer Link" which has the following features

  • Aspire EasyStore h340 Icon
  • Link to your home server displayed in "My Computer"
  • Double click the link to browse the home server shares
  • Right click the link to:
    • Browse the home server shares
    • Access the home server console
    • Remotely computer manage the home server
    • Remote desktop to the home server

AspireHomeMyComputerLink_ContextMenu

Very nice idea. I’m going to run off and try this right now.

Everyone who is familiar with the Windows Home Server user interface has seen LineBox in action. It’s used by Microsoft to group configuration sections in the Settings dialog box, and provides developers with a UI element that compliments the rest of Windows Home Server.

Here is an example of LineBoxes used in anger:

image

The problem with LineBox is that it wasn’t ever created to be used in the Visual Studio forms designer. This makes it a pain to layout clean interfaces using LineBox in a graphical view. These are the things you can’t change in the designer, but should be able to:

  • Title text
  • Title font
  • Title font colour
  • Spacing between the title text and the line

You can tweak all these things in code, but I’ve been using so many LineBoxes recently that I decided to extend it to make it a more designer-friendly control.

Here’s the result:

using System.Drawing;
using Microsoft.HomeServer.Controls;

namespace Microsoft.HomeServer.HomeServerConsoleTab.DiskMgt.Gui
{
    public class DesignerLineBox : LineBox
    {
        public string Title
        {
            get
            {
                return Header.Text;
            }
            set
            {
                Header.Text = value;
            }
        }

        public Font TitleFont
        {
            get
            {
                return Header.Font;
            }
            set
            {
                Header.Font = value;
            }
        }

        public Color TitleColor
        {
            get
            {
                return Header.ForeColor;
            }
            set
            {
                Header.ForeColor = value;
            }
        }

        public int LineMargin
        {
            get
            {
                return LineHoriz;
            }
            set
            {
                LineHoriz = value;
            }
        }
    }
}

Now I can drag my DesignerLineBox off the Toolbox in Visual Studio, right into the designer, and change the text, font, and line spacing without having to do it in code and constantly check the results in the WHS Console.

image

Quick and easy, and it’ll save me loads of time.

WiX v3.0 is finally out of beta. Bob Arnson and Rob Mensching have the announcement up on their blogs.

WiX is a great tool that I recommend for packaging WHS Add-Ins for deployment. The XML configuration is nice and clean, and you have total control over the MSI package that comes out the end of the process. Plus, I have plenty of examples of WiX code scattered throughout this blog!

If you’ve been using a beta or daily build of WiX 3.0, you should download the update now.

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development