Jump to content
Software FX Community

How do I associate data with a Strip object?


User (Legacy)

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...