D
David
hello...
a want to create my own collection class...
i tryed it two ways, one then declarinf it as of IList interface (not easy
way) and like an ArrayList derived class (easy way)
in both ways i wanted to be able to "Add" o "insert" only objects of sertain
type... let's say derived from "MyClass"
and in both ways i did it by checking it in specific function, example:
public int Add (object value)
{
if (value is MyClass)
// it's good
else
throw...
}
the matter of thing is what i want to have function like
public int Add (MyClass value) ...
and not to see and be able to use
public int Add (object value)...
in windows forms is some how done with
TreeNodeCollection -- how?
a want to create my own collection class...
i tryed it two ways, one then declarinf it as of IList interface (not easy
way) and like an ArrayList derived class (easy way)
in both ways i wanted to be able to "Add" o "insert" only objects of sertain
type... let's say derived from "MyClass"
and in both ways i did it by checking it in specific function, example:
public int Add (object value)
{
if (value is MyClass)
// it's good
else
throw...
}
the matter of thing is what i want to have function like
public int Add (MyClass value) ...
and not to see and be able to use
public int Add (object value)...
in windows forms is some how done with
TreeNodeCollection -- how?