/Ratings/AttributeContainer.cs

https://github.com/Dracontis/Ratings · C# · 48 lines · 44 code · 4 blank · 0 comment · 0 complexity · abe36dbe4dcffc4ead8491b93bede6a8 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Xml.Linq;
  6. using System.Xml.XPath;
  7. using System.IO;
  8. namespace Ratings
  9. {
  10. class AttributeContainer
  11. {
  12. private String name;
  13. private object value = null;
  14. public AttributeContainer(String name, int value)
  15. {
  16. this.name = name;
  17. this.value = value;
  18. }
  19. public String Name
  20. {
  21. set
  22. {
  23. name = value;
  24. }
  25. get
  26. {
  27. return name;
  28. }
  29. }
  30. public int ValueAsInt()
  31. {
  32. int result;
  33. try
  34. {
  35. result = (int)value;
  36. }
  37. catch
  38. {
  39. result = 0;
  40. }
  41. return result;
  42. }
  43. }
  44. }