I have c# file with all contents contained in a namespace LinkedList saved with the name linkedlist.cs . This file doesn't have a main() method. I want to include the content of that file or that namespace in another file.
How can I do that ?
I have c# file with all contents contained in a namespace LinkedList saved with the name linkedlist.cs . This file doesn't have a main() method. I want to include the content of that file or that namespace in another file.
How can I do that ?
Assuming your
LinkedList
is in a project calledMyLinkedListProject
, you will want to reference this project from the project inheriting it. As stated in the comments by @cdhowie you can then reference the namespace by adding theusing LinkedList;
which will reference the namespace.Depending on the content of linkedlist.cs will depend on how you access it, assuming it contains a class called
LinkedList
within theLinkedList
you would access the methods (of theclass
using code such asLinkedList.methodName();
(this would work for astatic
method, you'd have to instantiate aLinkedList
first if you require an "instance of the object" for the method to work.