Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface Example
- {
- // some stuff
- }
- public class Something
- {
- public List<IBindToKey> keybind ... // instantiate
- public Something()
- {
- keybind.ForEach(b =>
- {
- // these checks are what I want to reuse
- if (b.GetType() == typeof(Example1)
- (b as Example1).Value = // new value
- if (b.GetType() == typeof(Example2)
- (b as Example2).Value = // new value
- }
- }
- }
Add Comment
Please, Sign In to add comment