Skip to content

Start Customizing Your Application Software

Gary edited this page Aug 27, 2014 · 1 revision

Table of Contents

Begin the process of transforming the sample into your application.

Fix Up .sln File

Rename the solution file to something more appropriate for your development, such as ATFProjects.vs2010.sln.

Open the solution in Visual Studio and edit the project appropriately in the Solution Explorer pane:

  • Remove the ATF assembly projects you don't need.
  • Remove the ATF sample projects, except for the sample you are copying, "SimpleDomEditor" in this case.
  • Rename the "SimpleDomEditor" project "LandscapeGuide.vs2010".
Change all the namespace statements in the source .cs files to something appropriate. In this case, they are changed to:
namespace LandscapeGuide

When you change the namespace, also change it in the Project settings > Application page's Default namespace field. Change Assembly name on this page appropriately, too.

In SchemaLoader.cs, you must also change the name of the namespace:

SchemaResolver = new ResourceStreamResolver(Assembly.GetExecutingAssembly(),
    "LandscapeGuide/schemas");
Load("eventSequence.xsd");

If you don't change Default namespace for the project, when you run, you get an unhandled exception of type System.ComponentModel.Composition.CompositionException in Atf.Core.dll. This results from a problem with the above lines in SchemaLoader.cs. Because the default namespace is not set properly, the schema address is not resolved, so Load() fails. Note that "LandscapeGuide/schemas" is the namespace in the code above.

Build the slightly modified project again and verify that it still runs properly, making changes as needed.

Remove Code

If you have not already done so, you should become familiar with the code in the sample you're renovating. After doing this, you can figure out what code you don't need.

You can start by removing files from the project that aren't relevant. In SimpleDomEditor, these files are not required for LandscapeGuide:

  • ResourceListEditor.cs: component that adds the Resources pane, which LandscapeGuide doesn't have.
  • DomNodeNameSearchControl.cs: provides the Search and Replace - DomNode Names pane.
  • DomNodeNameSearchService.cs: provides the Search and Replace pane.
  • DomNodeAdapters/Resource.cs: DomNode adapter for the "Animation" and "Geometry" resources, which are not used in LandscapeGuide.
  • EventContext.cs: Editing context that provides a context for updating the views of the Resources pane.

Remove MEF Components

In Program.cs, you can remove the following components from the MEF catalog, because their capabilities are not used in LandscapeGuide and their corresponding files have already been removed:

  • DomNodeNameSearchService
  • DomNodePropertySearchService
  • ResourceListEditor
Rebuild the project again and verify that it still runs, making changes as needed. (You need to remove a reference to EventContext in SchemaLoader.cs to build.) The panes created by the removed components are now gone, but the rest of the application should still function.

Modify Resources

Remove resources you don't need, such as graphics files. Remove references to these resources in the Resources class in the Resources.cs file also.

Modify the About.rtf file to describe your new application. Change HelpAboutCommand.cs to suit the new application, as in:

using (AboutDialog dialog = new AboutDialog(
    Localizer.Localize("Landscape Guide"), appURL, richTextBox, null, null, true))

Once you make these changes, though, the original application won't run properly, because it is missing resources. This gets fixed in subsequent steps.

Topics in this section

Clone this wiki locally