C# using others code

后端 未结 4 1612
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 11:41

Iv\'e downloaded a C# interval tree collection class class from here http://intervaltree.codeplex.com/SourceControl/list/changesets -> Right hand side -> Download.

H

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 12:09

    Open the IntervalTreeLib.csproj file if you want to be able to open the project in it's entirety (or in your current solution add an existing project (you can right-click on the solution) and select the IntervalTreeLib.csproj). If you are trying to grab just the code file in your project, ensure you also grab the PowerCollections.dll file (I see it is in the same folder as the code files) or your code will not compile (as you have discovered). You'll need to add a reference to it and include the needed using statement at the top of the code files making use of this library (or use fully qualified name with the namespace).

    using IntervalTreeLib;
    

    or

    var myObj = new IntervalTreeLib.[WhateverClass](...);
    

    Also, make sure you read the license.txt file. You may need to include it if you are using the code. Give credit where it is due.

    UPDATE:

    If the test project is causing you problems, just open the library project. Ideally you could just open that and compile it, adding the output DLL files that are generated directly into your solution. This is ideal unless you are planning on changing the library source code itself.

提交回复
热议问题