Solved

Generic Classes question

Posted on 2007-04-07
1
199 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
1 Comment
 
LVL 5

Accepted Solution

by:
Yttribium earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Name Space error VS2015 1 37
reading excel file in .net 2 33
Converting PHP triple des decrypt to c# 9 76
Installing .NET 3.5 on Windows Server 2012 1 63
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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