I don\'t want to make a new instance of Form1 in the class, and i dont want to use static
.
I have these two variables which are private in the top of the cl
There are two solutions to this:
Make the variables public properties - though there are issues around the use of lists so having a ReadOnlyCollection
wrapper is the way to solve this.
Create a public method that performs the required manipulations on the lists.
For example to add a point to the list you'd have:
public void AddValueToX(float value)
{
PointX.Add(value);
}
If you wanted to test whether a value was in the list (which is fraught with danger as you are dealing with single precision values):
public bool InListX(float value)
{
// A test on value vs the data in Point_X allowing for floating point inaccuracies
}