c# - Data persistance in class library between one class methods -


I am creating an class library for AutoCAD with .NET.

The problem is that the methods are called one after the AutoCAD one and the first reads an input file and creates a list of data in memory, even though the name is called when the new name is empty

I have to figure out how to keep that data. My built-in structure contains data in the data. I methods are called independently, but in order.

Short code example:

  Namespace GeoPjuvis {... public class program {... // program variable private list & lt; Geodata & gt; DataList; Private listing & lt; DataPoint & gt; Points; Private int map scale; Public shows () {dataList = new list & lt; GeoData & gt; (); Number = new list & lt; DataPoint & gt; (); } // The initial method of the program. The process creates the files Add points to the map [Commandmath] Public Zero Init () {...} // method first uses the data collected and selects the score [CommandAmpegen ("Selection Number" , Command flagsation.)] Public Zero Select Points () {...} ...  

So when I call the SelectPoints () method, these data lists and points lists are empty . And how to avoid it?

I do not know about programming for autocad, but I suspected it was a new one every time. Example making you can try to create the variable static (example category level):

  Private static list & lt; GeoData & gt; Data List = New List & lt; GeoData & gt; ();  

Comments