473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Clearing CollectionBase derived list

Hi,

I have two lists, the first is the complete list, so call it PermList, the
second is a subsection of that list, call this TempList, both are of the
same type, naemly strongly typed and derived from CollectionBase.

I assume that if I simply iterate thro the PermList list taking the elements
that I want and simply add them to TempList then, when I want to clear the
TempList in order to add the next subsection from PermList, by simply doing
TempList.Clear will only clear the pointers to the object from TempList
leaving them intact in PermList?

Is this true?

TIA
Colin
--
Colin Basterfield
Off the Roof Solutions
Nov 16 '05 #1
2 1350
On 02 Jul 2004 04:39, "Colin Basterfield" wrote:
Hi,

I have two lists, the first is the complete list, so call it PermList, the
second is a subsection of that list, call this TempList, both are of the
same type, naemly strongly typed and derived from CollectionBase.

I assume that if I simply iterate thro the PermList list taking the elements
that I want and simply add them to TempList then, when I want to clear the
TempList in order to add the next subsection from PermList, by simply doing
TempList.Clear will only clear the pointers to the object from TempList
leaving them intact in PermList?

Is this true?

Yep. Or TempList = null or TempList = new TempListType() will do the same
thing.
--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook
Nov 16 '05 #2
Hi,

Thought so, thanks Simon

--
Colin Basterfield
Off the Roof Solutions
"Simon Smith" <gh*****@community.nospam> wrote in message
news:8e******************************@ghytred.com. ..
On 02 Jul 2004 04:39, "Colin Basterfield" wrote:
Hi,

I have two lists, the first is the complete list, so call it PermList, thesecond is a subsection of that list, call this TempList, both are of the
same type, naemly strongly typed and derived from CollectionBase.

I assume that if I simply iterate thro the PermList list taking the elementsthat I want and simply add them to TempList then, when I want to clear theTempList in order to add the next subsection from PermList, by simply doingTempList.Clear will only clear the pointers to the object from TempList
leaving them intact in PermList?

Is this true?

Yep. Or TempList = null or TempList = new TempListType() will do the same
thing.
--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook

Nov 16 '05 #3

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

Similar topics

2
by: Colin Basterfield | last post by:
Hi, I have a list which is derived from CollectionBase, and it contains a list of User objects, which I want to Serialize out to an XML file. Is there anywhere where I can find how to decode...
0
by: Mike Pollett | last post by:
Hi, I have used the ISerializable interface before and the code below worked fine. Until I derived it from CollectionBase. The code will still serialize and deserialize the properties in this class...
1
by: Mike Pollett | last post by:
Hi, I have used the ISerializable interface before and the code below worked fine. Until I derived it from CollectionBase. The code will still serialize and deserialize the properties in this class...
5
by: Eric Johannsen | last post by:
I have a simple object that inherits from CollectionBase and overrides the Count property: namespace MyTest { public class CollTest : System.Collections.CollectionBase { public override int...
6
by: DelGator | last post by:
Foundation...Accessing derived class members through a variable of their base class is just a matter of casting the variable to the derived class. How would you access the derived class members...
2
by: Samuel R. Neff | last post by:
What's the advantage of inheriting from CollectionBase as opposed to just implementing IList? It seems that it saves you from having to implement a few properties (Clear, CopyTo, Count,...
0
by: Jay Sauls | last post by:
I've got a simple XML document (from an external source that I can't change) that I'm having trouble deserializing correctly. The document looks like: <?xml version='1.0'?> <quotes...
5
by: Tony | last post by:
Hello! Here I have a collection class Cards which is derived from the Base class CollectionBase. This class Cards is a container for Card object. Now to my question at the bottom of this class...
1
by: Tony | last post by:
Hello! I'm reading a book and here I have found something that sounds strange. It says the following: "Note that some classes in the System.Collection namespace, including CollectionBase, don't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.