[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Generic Classes question

Posted on 2007-04-07
1
Medium Priority
?
202 Views
Last Modified: 2013-11-07
Hi experts,
I wanted to build a sorted list structure something like the generic SortedList class in C# but I am not able to change the value of an element after Add()ing it (since it is readonly property). I need to read the value, sum it and write back, as I do not know its final value when I Add() it to the structure.
Is there a way to over come this limitation?
0
Comment
Question by:novknow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Yttribium earned 2000 total points
ID: 18872131
How are you using the sorted list, do you have an example?

When I did:

SortedList SL = new SortedList();
SL.Add("Obj1", 1);      
SL.Add("Obj2", 2);
SL.Add("Obj3", 3);
SL.Add("Obj4", 4);
SL["Obj1"] = 2;
MessageBox.Show(SL["Obj1"].ToString());

I didn't get a problem, probably I misunderstand your usage.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question