Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2. public IDictionary<Type, IParsingStrategy> Switch { get; } = new Dictionary<Type, IParsingStrategy>
  3. {
  4. { typeof(string), new StringParsingStrategy() },
  5. { typeof(int), new IntParsingStrategy() },
  6. { typeof(long), new LongParsingStrategy() },
  7. { typeof(double), new DoubleParsingStrategy() },
  8. { typeof(bool), new BoolParsingStrategy() },
  9. { typeof(sbyte), new SByteParsingStrategy() },
  10. { typeof(short), new ShortParsingStrategy() },
  11. { typeof(float), new FloatParsingStrategy() },
  12. { typeof(char), new CharParsingStrategy() },
  13. { typeof(decimal), new DecimalParsingStrategy() }
  14. };
  15.  
  16. strategy = Switch[prop.PropertyType];
  17. strategy.Parsing(prop, EventTemplate, item);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement