This is pretty dirty, but if the value of T is always the same for a given PointF, you can use extension methods to mimic the get / set behavior offered by the properties. Assuming you are using a C # 3.0 compiler, you can do something like this.
public static class PointFExtensions
{
private static Dictionary<PointF, float> _dict = new Dictionary<PointF, float>();
public static void SetT(this PointF self, float t)
{
_dict.Add(self, t);
}
public static float GetT(this PointF self)
{
return _dict[self];
}
}
Then you can use these methods as follows:
PointF pf = new PointF(4.0F, 5.0F);
pf.SetT(42);
float t = pf.GetT();
source
share