Guest User

Untitled

a guest
Jun 21st, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public T Read<T>(string comment)
  2. {
  3. T value = default(T);
  4. Type s = typeof(T);
  5. MethodInfo i = this.r.GetType().GetMethod("Read"+s.Name);
  6. if(i != null)
  7. { value = (T)i.Invoke(this.r, new object[] { });
  8. }
  9. if (comment != null)
  10. {
  11. AddString(value, comment);
  12. }
  13. else
  14. {
  15. Console.WriteLine("Comment cannot be empty!!");
  16. }
  17. return value;
  18. }
Add Comment
Please, Sign In to add comment