User (Legacy) Posted March 14, 2003 Report Posted March 14, 2003 I have a chart where the user interactively draws Stripes. I want to be able to associate some data, such as a name, with each stripe. It would have been very handy to subclass the Stripe class, then add my own data, but it is sealed. Is there any other hook in the Stripe class that can be used to hold additional data, or must I maintain my own array with data that shadows the chart's StripesCollection? One other question about creating stripes. Is this always a safe way to get the last added stripe? It assumes that the when a stripe is added, it is the last stripe. But what would happen if there were 10 stripes, then 3 were deleted, then this code executed? Is chart1.Stripes[7] the latest stripe? int stripeCount = chart1.Stripes.Count; currentStripe = chart1.Stripes[stripeCount]; Mitch
Software FX Posted March 14, 2003 Report Posted March 14, 2003 I'm afraid keeping the array on your own is the only solution. We don't allow sub-classing because of serialization issues. As for the indexer, the axis collection can be seen as an array, if you delete elements in the middle, the index of the elements below it will change. If you do Stripes[n] and n is outside of the array boundaries, the array will be adjusted to contain (n+1) stripes. -- FP Software FX, Inc.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.