C# basic question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi !

I am not familiar with C# and I would like to add a key sensitivity list to
an object. For example I would like to specify the Enter Key to Object1.
Object1.AddKey = (ascii code)
and to test if a key is on this list
Object1.IsOnList(Enter)

Do you have idea of what I can use ?

Thanks in advance,
Regards.

Sadi.
 
Have a look at Collection and the Collections namespace. There is plenty in
there which will do what you need.

Hope this helps.

Matt.
 
Hi Sadi,

Take a look on System.Collections.ArrayList for example. It has Contains
method that you can use for testing. Actually it comes from IList interface
so all types that implement that interface should support it. However there
is no guarantee that all types provide meaningful implementaion for it.
Classes in System collection do so.
 
Thanks for your help, I managed to do what I want with arraylist.

Stoitcho Goutsev (100) said:
Hi Sadi,

Take a look on System.Collections.ArrayList for example. It has Contains
method that you can use for testing. Actually it comes from IList interface
so all types that implement that interface should support it. However there
is no guarantee that all types provide meaningful implementaion for it.
Classes in System collection do so.

--

Stoitcho Goutsev (100) [C# MVP]


Sadi said:
Hi !

I am not familiar with C# and I would like to add a key sensitivity list
to
an object. For example I would like to specify the Enter Key to Object1.
Object1.AddKey = (ascii code)
and to test if a key is on this list
Object1.IsOnList(Enter)

Do you have idea of what I can use ?

Thanks in advance,
Regards.

Sadi.
 
Back
Top