Advertisement
Guest User

Untitled

a guest
May 31st, 2016
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. //Ty masz tak
  2. public int Index;
  3.  
  4. public int GetIndex()
  5. {
  6.     return Index;
  7. }
  8. //A mógłbyś użyć get/set, czytelniejszy kod i możesz robić sobie "zebezpieczenia" przed zwracaniem jakiś indexów, zapobiegać ustawianiu //jako index nieporządanych liczb (wtedy wyrzucasz Exception) itd.
  9. public int _index;
  10.  
  11. public int Index
  12. {
  13.     get
  14.     {
  15.         return this._index;
  16.     }
  17.     set
  18.     {
  19.         this._index = value;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement