Integrating Software Parts for Project #2 ----------------------------------------- Open Visual Studio 2010 and create a new C# console application in a directory where you want to work. Name the Project Executive and name the Solution Project2. Using Windows Explorere, You will find a folder labeled Project2 that contains the solution file (.sln) and a folder named Executive that contains the Executive project and a file, Program.cs. In Visual Studio rename Program.cs to Executive.cs, rename the namespace to Project2 and rename the class to Executive. Go to Lecture #4 page, click on the Navigate Directory Trees link, right click on Navigate.zip and select save target as, selecting the Project2 directory (whereever you put that). Now right click on the zip file and select extract all, taking the default path. You now have two directories in Project2, one for Executive and one for Navigate. Repeat this process with Template Inserter Demo and Parser Folder, resulting in four directories in Project2, the Executive and one for each download. Now, in Visual Studio, right click on the Project2 solution at the top of Solution Explorer view and select: add->existing project, browse to the Navigate folder and select the Navigate project. That adds the navigate project to the Project2 solution. Open test.cs in the Navigate project and select the contents of its main function, e.g., everything between its opening and closing braces. Copy that (Ctrl-C) then open the Executive solution and paste (ctrl-v) inside its main function. Right-click on the Navigate project and select properties. Click on the Application tab and set the application type to class library. Build Navigate, which creates a Dynamic Link Library inside Navigate's bin\debug directory. In the Executive project right-click on references and select Add Reference. That will bring up a dialog that allows you to select the Navigate project. When the dialog closes it will copy the navigate.dll into the Executives bin\debug directory so that it is loaded when Executive.exe needs it. Add using System.IO; at the end of the using statements in the Executive. Right click on the Executive project, select properties, click on the debug tab and insert ../../.. in the Command Line Arguments text box. Change the Navigate.go("*.*"); to Navigate.go("*.cs"); Build and Run the Executive by clicking on Debug->Start without Debugging. Note that your executive has found all the C# files on the input path. Now we need to modify the Navigate code. What it does now is to display directory information. We need it to find files (which it is now doing as part of the display), save them in a container, and return to the Executive. To do that we will make a few changes to Navigator.go(). First remove all the Console.write statements. Let’s add a List files member to hold the files as Navigator finds them. In order to access this member data we have to remove the static qualifier from go()’s return type, which means we will have to create an instance of Navigator in our Executive. Whenever go encounters files it should save them in the List files member using its addRange member. Now we have to add a function for the executive to retrieve the files. We’ll call it getSources(), and have it return a List. After we make these changes let’s simply let the Executive display the found files. All the remaining steps I’ll leave for you to carry out, but let’s summarize: You need to create a Publish package that will use TextInserter to make a webpage. First, in the TextInserter Project let’s use the add->new item->class selection and name the package Publish.cs. Add to our Executive file loop a call to Publish’s makePage function and add this function to the Publish class. You will use TextInserter to implement most of the makePage functionality to get a non-clickable web page. Now use locator to find the important parts of the newly created page and pass its table to a MakeClickable package to insert spans at the appropriate places. Add an Output package to build the directory page. Test as you go and test more here. What's in this solution and what do you need to do? --------------------------------------------------- Essentially what I built during the Friday morning Help Session. - Executive that has a loop to step through files found by Navigate. - Navigate with heavily modified, but simpler code. - Publish which as mock functions to do the beginning of what is needed to make a webpage. - TextInserter, unmodified from the class demo. You will have to modify it to to put source code between a template's pre tags. - All of the parts of Parser, with the project renamed to locater. You don't have to modify any of this. Just use it in Publisher (you'll have to make a reference to the Locater project). - Create the Output package and provide code to generate the page of links to published files.