The methods in the MediaCollection interface allow you to execute commands before and after the action performed by those methods. To do this, each method within MediaCollection is provided in two formats: one with the before/after functionality and one without. The one that contains before/after functionality accepts the CommandList beforeMethods and CommandList afterMethods parameters. These parameters call a command list before or after a method is run and execute the commands(s) included in that list.
See the Code Samples section for an example of how to use before and after commands within MediaCollection methods.