I'm trying to refactor some of our Script# code to reduce duplicate code. I'm trying to use generics to accomplish this but Script# refuses to build when I add this code (the only message it gives me is 'Build failed'):
public abstract class PageManagerBase<TItem>
{
public List<TItem> _items;
}
Does anyone know if there's a workaround for this?
Script# supports generics for internal types only, so things like
Dictionary<TKey, TValue>, orList<T>, but doesn't support custom types that you would create yourself.So, you can use the ones that are already provided for you, but you can't create your own.