When accessing a resource using Application.GetResourceStreamit, it returns an instance of the class StreamResourceInfo; this class does not implement IDisposable.
Application.GetResourceStream
StreamResourceInfo
Should I close \ dispose the underlying thread open StreamResourceInfowhen I finished processing the thread on the WP7 device - I don't want to know about Usingor the Dispose pattern.
Using
As an example, you can use the method to access the ZIP file contained in the ZAP package, and as soon as I unzip the file, I no longer need an instance Stream.
Stream
using, Close() Dispose().
using
Close()
Dispose()
StreamResourceInfo Close() Dispose() ( StreamResourceInfo Stream - , ), , , .
, StreamResourceInfo , Dispose() Stream , Reflector, , . IDisposable .
IDisposable
, , Close() Stream.
Windows 7 , , , , . , . , , .
Using dispose Using. , - . , , .
using (var stream = Application.GetResourceStream(new Uri("myResource.zip", UriKind.Relative)).Stream) { //stream code }
EDIT - : StreamResourceInfo / Stream. (, StreamReader), . , , .