Worksheet2 - CSE 459.24 Programming in C# In-Class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 459.24 Programming in C# Roger Crawfis In-Class Worksheet #2 Overview For this worksheet, we will create a class library and then use the resulting dll in a console application. This worksheet is a start on your next programming assignment, where we will build a directed acyclic graph (a DAG) and traverse it using an interface (which we will call IVisitor). Each node in the graph will be of type ISceneNode. The goal here is to allow multiple implementations of the IVisitor that can be determined at run-time. It uses method overloading to resolve the scenenode’s type at runtime. We will have several different flavors of ISceneNode’s and will define interfa ces for each of these flavors. Before You Start In Programming Assignment #2 you will be implementing a scene graph. I would advise you to take a look at the assignment before you begin this worksheet. Things to understand before you begin: What a scene graph is. The visitor design pattern. In addition to the resources listed on the assignment you may find the details section of this wiki page helpful. A basic understanding of the class hierarchy in the assignment. Creating a Class Library You should have Visual Studio 2008 open. 1. Create a new Project either from the shortcut on the Start page or through the file menu, 2. Select the type to be a C# Class Library. This will create a .dll file rather than an .exe file. Dll’s are loaded at runtime. Where the runtime finds these dll’s is a rather complex set of paths. This was touched upon in the early material for the course, but is not important for this level. Here the .dll will be in the same directory as the .exe file. For more information on dll’s go to . Note, that for the most part dll’s are being used in place of statically linked in libraries (.lib files). In C++, we probably would have implemented a library rather than a dll. 3. In the Location textbox, enter your desired hard drive location. Note that this will be on the mounted z: drive in the CSE environment. 4. Name the library ISceneGraph. 5. Select OK. 6. You will notice that Visual Studio has created a file called Class1.cs and opened it in the Code View. Note the namespace used and the class name. Right-click on this file in the Solution Explorer and Delete it. 7. Select the menu item Project->ISceneGraph Properties . Here you will see that it is building a class library, the name of the library (dll), the environment support it needs, etc. 8. Change the Default Namespace to your lastname.SceneGraph (e.g., Crawfis.SceneGraph). Now any new files added (to this project) will be encapsulated in this namespace. You can always change this in the .cs file to another namespace or class name.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/27/2012 for the course CSE 459.24 taught by Professor Crawfis during the Winter '11 term at Ohio State.

Page1 / 7

Worksheet2 - CSE 459.24 Programming in C# In-Class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online