Advertisement
claukiller

apuntes ienumerable

Mar 17th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. IENumerable<T> func<T> (...)
  2. foreach (var s in list)
  3. yield return x (T);
  4. ^
  5. IENUMERABLE LA CLASE PRINCIPAL Y LA MYENUMERATOR ENUMERATIR<T>
  6. DOS GETENUMERATOR OBJECT Y T EN LA PRINCIPAL
  7.  
  8. inumerable -> foreach sin el no hay
  9. tiene un metodo -> getEnumerator that returns MyEnumerator
  10. MY enumerator clase que implementa ienumerator
  11. you dont modify the original class my enumeator es la q haz todo
  12. tiene myenumerator un counter
  13. movenext (adds to the counter)
  14. current - > element que usas (posision actual)
  15. reset - > -1 porque el foreach llama a movenext y entos se mueve a 0 (pone al counter a -1)
  16.  
  17. 2 current
  18. copy and paste the currents de fibonacci
  19.  
  20. getEnumerator {MyEnumerator(this)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement