SourceActions: code cleanup

- Removed unused usings.
- Converted property to auto-property.
- Use new lambda delegate syntax.
- Add missing braces in foreach and if blocks, to conform to
style guidelines.
- Use a static cast instead of a dynamic cast (as it was not
checking for null, and could lead to NREs instead of ICEs).