如何检查流是否已更改? [英] How to check if stream has changed?

查看:80
本文介绍了如何检查流是否已更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以异步检查流,或者发生某些更改事件?
在此先谢谢您.

Is there any way to check stream asynchronously , or have some event for its change?
Thanks in advance.

推荐答案

这是非常简单的事情或您的代码设计.

没有这样的事件,任何流类中都没有事件,通常它们并不需要太多.如果需要它们,请围绕您要使用的流或流编写器类(类)实现一些包装.公开所需的所有方法,并包装要在自己的方法中使用的流(或流编写器)写方法,以触发可以在包装器类中引入的事件.始终在应用程序代码中使用包装器;不要直接使用包装的类.

我希望您知道如何声明,触发和使用事件,否则您不应该问这个问题.

—SA
This is a very simple matter or your code design.

There are no such events, no events in any stream classes at all, they are generally not much needed. If you need them, implement some wrapper around stream or stream writer class (classes) you want to use. Expose all methods you need and wrap stream (or stream writer) write methods you want to use in your own methods firing the events you can introduce in your wrapper class. Always use your wrapper(s) in your application code; don''t use wrapped classes directly.

I hope you know how to declare, fire and consume events, otherwise you should not have asked this question.

—SA


这篇关于如何检查流是否已更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆