HMScriptErrors.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System.Xml;
  2. namespace System.Net.HomeMatic {
  3. public class HMScriptErrors :HMElement {
  4. private int _timestamp;
  5. private int _row;
  6. private int _col;
  7. private string _code;
  8. private string _msg;
  9. /*public override bool Equals(object o) {
  10. if (o == null) return false;
  11. if (
  12. ((HMScriptErrors)o).Row == this._row &&
  13. ((HMScriptErrors)o).Col == this._col &&
  14. ((HMScriptErrors)o).Code == this._code &&
  15. ((HMScriptErrors)o).Message == this._msg &&
  16. ((HMScriptErrors)o).TimeStamp == this._timestamp
  17. )
  18. return true;
  19. else
  20. return false;
  21. }
  22. public static bool operator ==(HMScriptErrors c1, HMScriptErrors c2) {
  23. if (c1 == null || c2 == null) return c1 == null && c2 == null;
  24. return c1.Equals(c2);
  25. }
  26. public static bool operator !=(HMScriptErrors c1, HMScriptErrors c2) {
  27. if (c1 == null || c2 == null) return (c1 != null || c2 != null);
  28. return !c1.Equals(c2);
  29. }*/
  30. public override string ToString() {
  31. return "[System.Net.HomeMatic.HMScriptErrors[" + this.ValuesToString() + "]]";
  32. }
  33. private string ValuesToString() {
  34. return this._timestamp.ToString() + ";" +
  35. this._row.ToString() + ";" +
  36. this._col.ToString() + ";" +
  37. this._code + ";" +
  38. this._msg + ";";
  39. }
  40. public HMScriptErrors(HMApi Api) : base(Api) {
  41. }
  42. public HMScriptErrors(HMApi Api, XmlNode Data) : base(Api) {
  43. this.Init(Data);
  44. }
  45. private void Init(XmlNode Data) {
  46. this._timestamp = this.Attr_Int32(Data, "timestamp");
  47. this._row = this.Attr_Int32(Data, "row");
  48. this._col = this.Attr_Int32(Data, "col");
  49. this._code = this.Attr_String(Data, "code");
  50. this._msg = this.Attr_String(Data, "msg");
  51. }
  52. public int TimeStamp {
  53. get { return this._timestamp; }
  54. }
  55. public int Row {
  56. get { return this._row; }
  57. }
  58. public int Col {
  59. get { return this._col; }
  60. }
  61. public string Code {
  62. get { return this._code; }
  63. }
  64. public string Message {
  65. get { return this._msg; }
  66. }
  67. }
  68. }