IObservable<T>
和 IObserver<T>
接口(interface)直接放在System
.NET Framework 4.0 Beta2 中的命名空间。为什么不在 System.Collections.Generic
, 比如 IEnumerable<T>
?
附注Silverlight Toolkit 的 Reactive Framework 预览包含 IObserver<T>
在System.Collections.Generic
命名空间。
最佳答案
IObservable是一个接口(interface),用于标识实现 Observer 的类图案。它与收藏无关。它更多地与提供事件的替代方案有关。
关于.net-4.0 - .NET Framework 4.0 Beta2 中的 IObservable<T>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1620434/