C# using others code

c#, class, interval-tree

Solution

Add the library to your solution

Copy the IntervalTreeLib directory into your solution directory. Then, right-click your solution, and add existing project. Point it at `IntervalTreeLib.csproj` in IntervalTreeLib, and click Open. That should add the IntervalTreeLib project to your solution.

Add a reference to the library in your project

Then, in your project, add a reference to the IntervalTreeLib proejct: - Right click the References folder, and Add Reference. Click the Projects tab, and select IntervalTreeLib.

Use the classes in your code

To use classes from the library in your source then, you need to either add:

using IntervalTreeLib;

void Foo() {
    IntervalTree<int, int> tree = new ...
}

Or, refer to them by their full name:

IntervalTreeLib.IntervalTree<int, int> tree = new ...

Problem

Iv'e downloaded a C# interval tree collection class class from here http://intervaltree.codeplex.com/SourceControl/list/changesets -> Right hand side -> Download. However I can't open the whole project on my Microsoft Visual C# 2010 Express (that also runs C# XNA) because Solution folders are not supported in this version of the application Also I just want the class to use separately in my own seprate project. I tried to copy the three important seeming files `Interval.cs`, `IntervalNode.cs` and `IntervalTree.cs` into my project but this generated the compile error There are no importers which handle this file type I've also tried to copy and paste the contents of the three files into my project, encapsulating them into there own namespace as well as there was a lot of code. I had to rearange some of the usings a little but have run into the problem that possibly it wants PowerCollections .dll and .pcb files as `using Wintellect.PowerCollections;` causes The type or namespace name 'Wintellect' could not be found (are you missing a using directive or an assembly reference?) I'm not sure how to continue or if I'm doing the right thing at all in how to get this class to work.

Original source