fork(2) download
  1. private int _a;
  2. public int A
  3. {
  4. get { return _a; }
  5. set
  6. {
  7. // ゼロ未満ならゼロにする。
  8. if (_a < 0)
  9. {
  10. _a = 0;
  11. return;
  12. }
  13. _a = value;
  14. }
  15. }
  16.  
  17. public event EventHandler<EventArgs> BChanged;
  18.  
  19. private int _b;
  20. public int B
  21. {
  22. get { return _b; }
  23. set
  24. {
  25. if (_b == value)
  26. {
  27. // 値が変わっていない。
  28. return;
  29. }
  30. // 値が変わったらイベントを発生させる。
  31. _b = value;
  32. if (BChanged != null)
  33. {
  34. this.BChanged(this, EventArgs.Empty);
  35. }
  36. }
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,16): error CS1525: Unexpected symbol `int', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
prog.cs(2,15): error CS1525: Unexpected symbol `int', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
prog.cs(17,15): error CS1525: Unexpected symbol `event', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
prog.cs(19,16): error CS1525: Unexpected symbol `int', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
prog.cs(20,15): error CS1525: Unexpected symbol `int', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Compilation failed: 5 error(s), 0 warnings
stdout
Standard output is empty