Jump to content
Software FX Community

How do I associate data with a Strip object?


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...