Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » Concerning Collection Object


Concerning Collection Object

Reply
  #1 (permalink)  
Old 07-28-05, 01:25 PM
DevinG DevinG is offline
New Member
 
Join Date: Jul 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Concerning Collection Object

Hello I noticed in VB.net you can have the Collection object, however in C# i can not find where the collection object exists... If it exists. Does anyone know how i can create a generic Collection Object.

The code for the VB.net Collection Object is:

public aCollectionObj as New Collection
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-13-06, 02:46 PM
Squintz Squintz is offline
Newbie Coder
 
Join Date: Jan 2006
Location: Maryland
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
using Microsoft.VisualBasic;
Collection aCollectionObj = new Collection();

I was curious about the answer to this also and it seem that collections are handled a little differnt in VB.net. You may be able to get around the issue by using the Microsoft.VisualBasic namespace which should expose all the VB objects to you. However, I have not tried this so I do not know that for sure.

Just the other day I had to create a collection of my own object. I found an example of how to Implement the IList interface which was the only method that I could use because I also needed to inherit from MarshalByRefObject and you can only inherit from one object but may implement many interfaces.

So basically what I did was created MyClass and then created a second class which I called MyClassCollection. The in that class I implemented the IList.

I have to run but will get back to you with more details if you want them.

Try using this vb.net to C# translator if you have more situations like this.
http://www.carlosag.net/Tools/CodeTr...r/Default.aspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sorting a Collection or an ArrayList in VB.NET digioz Windows .NET Programming 8 09-11-09 11:44 AM
Error in OleDBConnection : Object reference not set to an instance of an object pvsunil Windows .NET Programming 1 04-22-05 02:45 PM
Quick question dealing with object arrays dmiranda Everything Java 2 01-09-05 05:15 AM
null or not an object ccgorman JavaScript 2 10-27-04 07:59 AM
javascript object hidden by flash object morlack JavaScript 1 03-09-04 06:36 AM


All times are GMT -5. The time now is 01:42 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.