Making tools that can take either layer or feature class as input

Discussion created by crispincooper on Sep 7, 2011
Latest reply on Sep 8, 2011 by crispincooper
When using arc's inbuilt tools (e.g. data management->fields->delete field) it is possible to drag a layer onto the input parameter box, even though the tool may have requested a table or feature class.  This is great for usability :)

However, it's not clear to me how to implement this behaviour when writing custom tools.  Are there any examples around?