Okay, the title is a bit fuzzy, but I couldn't think of anything else.
Here's the scenario:
Say I have a base type:
And a default type, let's say:
Now I have a bit of code that checks a list and decides what type to assign, for example:
This whole list is created automatically and types are assigned by the file extension.
My problem now: How can I allow a user to easily insert his own type derived from the base one as to allow the initialization process to correctly assign his type to his preferred extension?
I suppose some pseudo code would look like:
If this doesn't make sense I'm sorry, but this is as readable as I can make it :)
Here's the scenario:
Say I have a base type:
Type Base Field Stuff Method Load() Abstract EndType
And a default type, let's say:
Type Default1 Extends Base Method Load() 'Load stuff EndMethod EndType
Now I have a bit of code that checks a list and decides what type to assign, for example:
Function DoStuff() Local t:Base For t = EachIn MyList t.Load() Next EndFunction
This whole list is created automatically and types are assigned by the file extension.
My problem now: How can I allow a user to easily insert his own type derived from the base one as to allow the initialization process to correctly assign his type to his preferred extension?
I suppose some pseudo code would look like:
Function GetCustomTypes() Local t:LoadingType For t = EachIn TypesList If (file.extension = t.Extension) Local x:[Custom type] = new [Custom type] <--- I have now idea how or if I can do this 'Fill fields MyList.AddLast(x) Next EndFunction
If this doesn't make sense I'm sorry, but this is as readable as I can make it :)