You need a class that wraps the array assignment, so you can perform whatever actions you want on the assigned data (in your case a translation). Notice the self-indexer in PointList ( "this[int Index]" ), this is what gives the illusion of indexing the array while in fact you're indexing the class (see code at bottom).
Code:
public class PointList
{
public PointList(System.Drawing.PointF[] Points, System.Drawing.PointF[] TranslatedPoints)
{
_Points = Points;
_TranslatedPoints = TranslatedPoints;
}
public System.Drawing.PointF this[int Index]
{
get
{
return _Points[Index]; //Retrieve the original point
}
set
{
_Points[Index] = value; //Store the original point
_TranslatedPoints[Index] = TranslatePoint(value); //Store the translated point
}
}
private System.Drawing.PointF TranslatePoint(System.Drawing.PointF Point)
{
//*** Translate somehow ***
return Point;
}
private System.Drawing.PointF[] _Points;
private System.Drawing.PointF[] _TranslatedPoints;
}
public class SomeClass
{
public SomeClass()
{
//Not sure if it's your intention to store both original and translated points,
//but if so you need two arrays
_Points = new System.Drawing.PointF[666];
_TranslatedPoints = new System.Drawing.PointF[666];
_InputArray = new PointList(_Points, _TranslatedPoints);
}
public PointList InputArray
{
get
{
//Expose the PointList class
return _InputArray;
}
}
private System.Drawing.PointF[] _Points = null;
private System.Drawing.PointF[] _TranslatedPoints = null;
private PointList _InputArray = null;
}
Then you can use it like so:
Code:
var c = new SomeClass();
c.InputArray[23] = new System.Drawing.PointF(12.34f, 56.78f);