Tuesday, May 29, 2007

Stage 1: Creating the Shell and the Form

  1. Create a new Windows Forms application named ShellApplication
  2. rename Form1.cs to ShellForm.cs
  3. Add Reference

    Microsoft.Practices.CompositeUI.dll
    Microsoft.Practices.CompositeUI.WinForms.dll
    Microsoft.Practices.ObjectBuilder.dll

  4. create a custom workitem
    1. create a new class named ShellWorkItem.cs
    2. Inherit class from WorkItem and include namespace
      using Microsoft.Practices.CompositeUI;
      public class ShellWorkItem : WorkItem
      {
      }
  5. modification in program.cs
    1. rename Program.cs to ShellApplication.cs
    2. include namespace
      using Microsoft.Practices.CompositeUI.WinForms;
    3. Replace the static class ShellApplication with a public class that inherits from FormShellApplication
      public class ShellApplication :
      FormShellApplication<shellworkitem,shellform>
      {
      }
    4. [STAThread]
      static void Main()
      {
      new ShellApplication().Run();
      }

No comments: