473,395 Members | 1,574 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,395 software developers and data experts.

custom collection using generics

Given the Class named KeyValue is the declaration for the Dictionary
version correct? I can't get the IDE to like it. This is VS2005 beta
2. I think i am doing something wrong but i don't see it.

Public Class KeyValue
Dim _keyID As FieldAttributes
Dim _value As FieldAttributes
'public accessors omitted
End Class
Public Class KeyValueDictionary(Of KeyValue) : Inherits DictionaryBase
Public Sub Add(ByVal value As KeyValue)
Dictionary.Add(value.keyID.value, value) 'ide doesn't like this line.
End Sub 'Add
end Class

dan
Nov 21 '05 #1
1 1014
Hi,

Try this instead

Public Class KeyValueDictionary: Inherits DictionaryBase
Public Sub Add(ByVal value As KeyValue)
Dictionary.Add(value.keyID.value, value) 'ide doesn't like this line.
End Sub 'Add
end Class

Ken
----------------
"Dan Holmes" <da*******@bigfoot.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Given the Class named KeyValue is the declaration for the Dictionary
version correct? I can't get the IDE to like it. This is VS2005 beta 2.
I think i am doing something wrong but i don't see it.

Public Class KeyValue
Dim _keyID As FieldAttributes
Dim _value As FieldAttributes
'public accessors omitted
End Class
Public Class KeyValueDictionary(Of KeyValue) : Inherits DictionaryBase
Public Sub Add(ByVal value As KeyValue)
Dictionary.Add(value.keyID.value, value) 'ide doesn't like this line.
End Sub 'Add
end Class

dan

Nov 21 '05 #2

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

Similar topics

6
by: Michael D. Ober | last post by:
In VB 6, the loop iterator v in the following code must be a variant. dim v as variant dim c as new collection for each v in collection ... next v What is the general translation in VB 7.1...
3
by: Michael Fällgreen | last post by:
Hi, I need to make a strongly typed collection of x, and the simplets way is to inherits list(of x). With that I can bind to a list-control. However - i don't need all the methods from list(of...
3
by: Jeff Louie | last post by:
Here is my try at generics. This creates a collection that implements IInvoke and IDisposable and Adds types that implement IInvoke and IDisposable. When the collection goes out of using scope...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
3
by: Nick | last post by:
I am developing a new management system for my company, and with it have 3 layers of functionality written in VB.NET 2.0. In the business logic layer I have a user class which contains all user...
6
by: MikeSwann | last post by:
Dear All, I am trying to decide on to create a collection object for a project that I am working on. I am fairly new to OOP so this may be on the basic side. I have looked on the groups, but...
4
by: Stuart | last post by:
I hope someone can shed some light on an error I've been experiencing for sometime now, but can no longer continue to ignore :-( I've created a custom entity class which implements IEditableObject....
14
by: cwineman | last post by:
Hello, I'm hoping to do something using Generics, but I'm not sure it's possible. Let's say I want to have a bunch of business objects and a data access class cooresponding to each business...
6
by: Erick | last post by:
I've created a class called Procs and a collection class called Processes which uses a hastable object to store the Procs. Now i want to enumerate with the "For each" to extract all the Procs in...
7
by: Dale | last post by:
I have a design question. I am creating a custom collection of products. The unique key for the products is productId which is an integer. By default, IndexOf(object obj), when obj is an int,...
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?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.