WCF:为什么客户端的IDisposeable实现是私有的? [英] WCF: Why is the client's IDisposeable implementation private?
问题描述
为什么WCF客户端的IDisposeable实现是私有的?
我很高兴您仍然可以通过转换或使用(..){..}来Dispose()
因为确实实现了IDisposable,但设计推理是什么?
使Dispose()成为私有的?
Jon
Why is the IDisposeable implementation of WCF clients private?
I''m glad that you can still Dispose() by casting or with using ( .. ) { .. }
because IDisposable is indeed implemented but what was the design reasoning
to make Dispose() private?
Jon
推荐答案
* Jon Davis写道,On 21-5-2007 23:59:
* Jon Davis wrote, On 21-5-2007 23:59:
为什么是私有的WCF客户端的IDisposeable实现吗?
我很高兴您仍然可以通过强制转换或使用(..){..}
来Dispose()
,因为确实实现了IDisposable,但设计推理是什么?
使Dispose()变为私有?
Jon
>
这通常在有关闭,结束或完成功能时完成,
将为您调用Dispose。
>
Jesse
This is usually done when there is a Close, End or Finish function,
which will call Dispose for you.
Jesse
" Jesse Ho uwing" < je *********** @ nospam-sogeti.nlwrote in message
news:u
"Jesse Houwing" <je***********@nospam-sogeti.nlwrote in message
news:u
****** ******** @ TK2MSFTNGP04.phx.gbl ...
**************@TK2MSFTNGP04.phx.gbl...
> * Jon Davis写道,On 21-5-2007 23:59:
>* Jon Davis wrote, On 21-5-2007 23:59:
>为什么WCF客户端的IDisposeable实现是私有的?
我很高兴您仍然可以通过转换来Dispose()或者使用(..){
..},因为IDisposable确实已经实现,但设计是什么让Dispose()私有化?
>Why is the IDisposeable implementation of WCF clients private?
I''m glad that you can still Dispose() by casting or with using ( .. ) {
.. } because IDisposable is indeed implemented but what was the design
reasoning to make Dispose() private?
这通常在有关闭,结束或完成功能时完成,
将为您调用Dispose。
This is usually done when there is a Close, End or Finish function, which
will call Dispose for you.
我认为反过来,Dispose()会执行闭包,就像使用''使用''与Stream对象使用'/ b $ b'一样。
Jon
I had thought the reverse, that Dispose() would perform closures, as with
using ''using'' with Stream objects.
Jon
这篇关于WCF:为什么客户端的IDisposeable实现是私有的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!