idisposable
Why disposed object doesn't throw exception on using it after disposing?
Is it legal to call a method on disposed object? If yes, why? In the following demo program, I\'ve a disposable class A (which implements IDisposable interface).As far as I know, if I pass disposable[详细]
2023-04-05 08:54 分类:问答Is returning an object that implements IDisposable a good idea or not?
My scenario is this. I am using System.DirectoryServices.AccountManagement for dealing with AD users and groups. My Main method (this is a console app for now) calls into a method that returns Princi[详细]
2023-04-05 05:24 分类:问答Passing IDisposable as a parameter
Is it a good practice to pass IDisposable as a parameter to a method and dispose it inside that method. This is sort of inevitable when you have to use several threads. Well, the best practices says t[详细]
2023-04-01 22:31 分类:问答Yield return from a try/catch block [duplicate]
This question already has answers here: yield return with try catch, how can i solve it (10 answers) Closed 10 years ago.[详细]
2023-03-31 14:37 分类:问答Correct use of IDisposable pattern when using Managed C++ wrapper in C#
My C# class creates and uses Managed C++ object that wraps (allocates and uses) unmanaged C++ objects and resources. The Managed C++ class correctly implements IDisposable with Destructor and Finalize[详细]
2023-03-29 19:03 分类:问答Nulling Out Managed Resources on Dispose [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Any sense to set obj = null(Nothing) in Dispose()?[详细]
2023-03-28 00:23 分类:问答Calling Dispose when setting IDisposable properties?
I switched the FxCop rule today to point out any non-disposed IDisposables as errors, in a hope that it might help me track down some GDI leaks. Interestingly 开发者_开发百科it pointed me to an instan[详细]
2023-03-27 23:57 分类:问答Is IDisposable.Dispose() called automatically? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Will the Garbage Collector call IDisposable.Dispose for me?[详细]
2023-03-26 13:59 分类:问答Disabling/Fixing Code Analysis warnings from .Designer.cs files
I am using DataVisualization.Charting.Chart extensively, and for the most part it is working. However, I\'ve been running Code Analysis frequently, and have all my own warnings taken care of. But, the[详细]
2023-03-26 13:35 分类:问答Resolving code analysis "CA2000" rule in this scenario?
I\'m running a full code analysis on my project, and it says it has 500 issues. I\'ve boiled it down to 300 now, but I\'m struggling with an issue I can\'t seem to find a solution for.[详细]
2023-03-23 21:39 分类:问答