Solved

Generic Classes question

Posted on 2007-04-07
1
197 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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