SHARE
TWEET

Untitled

a guest Oct 21st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class MyClass
  2. {
  3.     private int _what;
  4.     public int Property
  5.     {
  6.         get
  7.         {
  8.             var lol = 0;
  9.             lol += 100500;
  10.             return lol;
  11.         }
  12.         set
  13.         {
  14.             _what = value;
  15.             if (_what < 100500)
  16.             {
  17.                 _what += 100500;
  18.             }
  19.         }
  20.     }
  21. }
  22.  
  23. class Kek
  24. {
  25.     public void SomeMethod()
  26.     {
  27.         var lololo = new MyClass();
  28.         lololo.Property = 100; // вызовется код в set
  29.         var rofl = lololo.Property; // вызовется код в get
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top