473,625 Members | 3,318 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Collecti ons.Generic.Sor tedList accessing

I have a list declared:

public System.Collecti ons.Generic.Sor tedList<int,
System.Collecti ons.Generic.Lis t<MTGTracer ActiveList
= new SortedList<int, List<MTGTracer> >();

The key is an integer and the value is a list of MTGTracer.

The documentation states:

This property provides the ability to access a specific element in the
collection by using the following syntax: myCollection[key].

This code appears to work fine.

int KeyIndex1 = ActiveList.Inde xOfKey(TraceDat a.ThreadID);
if (ActiveList[KeyIndex1].Count == 1)
{ do somethinthing.
}

How can I access a specific member of the MTGTracer list.
I have tried

ActiveList[KeyIndex1].[2].TicksInCalledR outines
to access the second in the list but the compiler wants an identifier to go
along with the [2].

What is the identifier?

Thanks
Tom
Jul 8 '06 #1
2 2054
Hi Tom,

use

ActiveList[TraceData.Threa dID][2]

This should work.

Joachim
ne************* **@charter.net schrieb:
I have a list declared:

public System.Collecti ons.Generic.Sor tedList<int,
System.Collecti ons.Generic.Lis t<MTGTracer ActiveList
= new SortedList<int, List<MTGTracer> >();

The key is an integer and the value is a list of MTGTracer.

The documentation states:

This property provides the ability to access a specific element in the
collection by using the following syntax: myCollection[key].

This code appears to work fine.

int KeyIndex1 = ActiveList.Inde xOfKey(TraceDat a.ThreadID);
if (ActiveList[KeyIndex1].Count == 1)
{ do somethinthing.
}

How can I access a specific member of the MTGTracer list.
I have tried

ActiveList[KeyIndex1].[2].TicksInCalledR outines
to access the second in the list but the compiler wants an identifier to go
along with the [2].

What is the identifier?

Thanks
Tom
Jul 8 '06 #2
Yes that did work great.

Thanks
Tom
Jul 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1798
by: Arnaud Debaene | last post by:
Hello all, One area where the .Net framework 1.1 is really poor is Collections : We've got very few choice concerning the containers and their characteristics (for example, ArrayList, Queue and Stack are the only "non-dictionary" avalaible containers, and only Stack has some complexity specifications). The worst thing however is the IEnumerator interface, which doesn't allow for insertion, deletion or even *modification* of an item...
2
2887
by: Howard Swope | last post by:
Could someone help explain thread safety issues in the System.Collections classes? The documentation states: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thread Safety Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe. A SortedList can support multiple readers concurrently,...
6
5937
by: Paul Delhanty | last post by:
Hi, I am converting an existing native C++ program making heavy use of STL to C#2.0 with STL usage replaced by the new generic collections. The conversion has gone well to the point where I am replacing an STL map instance by a System.Collections.Generic.SortedDictionary instance. In need the collection to be ordered, and to have o(log(n)) look up - that is fine so far SortedDictionary.TryGetValue does the job. I also need the...
3
9872
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't seem to get this to work in VB.Net. Here's what I have: OLD ASP Code: Function Get_ADS_Users_For_Group(ADS_Path) Dim Group_Information Dim Error_Number
2
3304
by: ljlevend | last post by:
I've noticed that in VS.NET 2.0 Beta 1 that none of the methods in System.Collections.Generic.List are overridable. In my app I currently have over 50 strongly typed ArrayLists that inherit from System.Collections.ArrayList. Each of these types raise strongly typed events for when items are added and removed (e.g., AddingItem, AddedItem, CollectionChanged, etc.). One of my hopes for v2.0 was to create a single generic List that replaces...
4
8178
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from System.Collections.Generic.Queue? Putting it another way can I safely replace a System.Collections.Queue.Synchronized(myUnSynchronizedQueue) with a System.Collections.Generic.Queue while porting a working 2003 project? Thanks,
6
4079
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible, having been advised by several luminaries that that is a "good thing to do"... :-) However, I'm experiencing a problem with the IEnumerable interface. (N.B. I understand fully that I should be using the LDAP provider instead of the WinNT provider...
2
7354
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... generic<typename T> public ref class SetOfProxy : public System::Collections::Generic::IEnumerable<T>
2
2629
by: confused1234 | last post by:
Hi i'm trying to pass a field of type System.Collections.Generic.ICollection< FeedImage> to a function. I dont't have a clue what this icollection is. but i tried some code System.Collections.Generic.ICollection< FeedImage> imagea ; FeedImage fee = new FeedImage ("http://www.image.com/image.jpg", "http://www.image.com");
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7184
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.