Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 4:25
Nuray21-Nov-05 4:25 
GeneralRe: Help needed for Array Class Pin
S. Senthil Kumar21-Nov-05 4:57
S. Senthil Kumar21-Nov-05 4:57 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 5:06
Nuray21-Nov-05 5:06 
GeneralRe: Help needed for Array Class Pin
Judah Gabriel Himango21-Nov-05 5:20
sponsorJudah Gabriel Himango21-Nov-05 5:20 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 5:31
Nuray21-Nov-05 5:31 
GeneralRe: Help needed for Array Class Pin
J4amieC21-Nov-05 5:45
J4amieC21-Nov-05 5:45 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 6:19
Nuray21-Nov-05 6:19 
AnswerRe: Help needed for Array Class Pin
Joshua Quick21-Nov-05 6:38
Joshua Quick21-Nov-05 6:38 
You can create your own array class which inherits from the System.Array class.
class MyArray : System.Array
{
   public Object GetXXX(int myKey)
   {
      foreach (Object obj in this)
      {
         // Find your object.
      }
      return null; // Object not found.
   }
}
[Modified]
Bummer. The above solution doesn't work. You're not allowed to derive from Array. However, the 2 solutions below will do the job.
[/Modified]

Or you can create your own "collection" class which inherits from the CollectionBase class.

Or you can create your own "collection" class which wraps an Array object. You should implement the ICollection and IEnumerable interfaces in this case.

-- modified at 14:08 Monday 21st November, 2005
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 7:00
Nuray21-Nov-05 7:00 
GeneralRe: Help needed for Array Class Pin
Joshua Quick21-Nov-05 8:06
Joshua Quick21-Nov-05 8:06 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 8:31
Nuray21-Nov-05 8:31 
GeneralRe: Help needed for Array Class Pin
Joshua Quick21-Nov-05 8:50
Joshua Quick21-Nov-05 8:50 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 8:59
Nuray21-Nov-05 8:59 
GeneralRe: Help needed for Array Class Pin
Joshua Quick21-Nov-05 10:19
Joshua Quick21-Nov-05 10:19 
GeneralRe: Help needed for Array Class Pin
Nuray22-Nov-05 5:10
Nuray22-Nov-05 5:10 
GeneralRe: Help needed for Array Class Pin
Joshua Quick22-Nov-05 5:44
Joshua Quick22-Nov-05 5:44 
AnswerRe: Help needed for Array Class Pin
Robert Rohde21-Nov-05 7:57
Robert Rohde21-Nov-05 7:57 
GeneralRe: Help needed for Array Class Pin
Nuray21-Nov-05 8:57
Nuray21-Nov-05 8:57 
GeneralRe: Help needed for Array Class Pin
Robert Rohde21-Nov-05 10:32
Robert Rohde21-Nov-05 10:32 
GeneralRe: Help needed for Array Class Pin
Nuray22-Nov-05 5:01
Nuray22-Nov-05 5:01 
QuestionFinding the System Idle Timer ? Pin
V3RO21-Nov-05 3:43
V3RO21-Nov-05 3:43 
QuestionProblem with blocked file access Pin
Weckmann21-Nov-05 3:42
Weckmann21-Nov-05 3:42 
AnswerRe: Problem with blocked file access Pin
S. Senthil Kumar21-Nov-05 4:34
S. Senthil Kumar21-Nov-05 4:34 
GeneralRe: Problem with blocked file access Pin
Weckmann21-Nov-05 8:32
Weckmann21-Nov-05 8:32 
QuestionHow to System Idle Timer Pin
V3RO21-Nov-05 3:34
V3RO21-Nov-05 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.