I have a class that accepts objects via an add method and then stores them in a list of objects:
I would like to add some methods that allow me to return a strong type (string, int, date) based on the specified tag. Is this possible? Doesn't a typed dataset do something similar based on the column datatype?
Code:
public class tagBuilder private _store as Dictionary(Of String, Object) public sub Add(tagName as string, tagValue as object) _store.add(tagName, tagValue) end sub end class
Code:
public function GetTag(tagName as string) ' pseudocode: ' - search _store for tagName ' - get value into object ' - cast object to actual type and return end function
Comment