?????????????????C#???????????????????????ο??????????£?
?????????C#?????????????????????????C#??????壬?????????????????????????????Щ???????????????е??????????????????????????????????C#??????????
????C#????????
???????COM???????????????????????C#?????????COM??????????????????????????????磬C#????????????IUnknown??C#??????.NET??????????????????COM???????C#?????????κ???????????????
?????????г?Microsoft????????????System.IDisposable?????????塣IDisposable???????????Dispose()???÷?????????У???????????????
????public interface IDisposable
????{
????void Dispose();
????}
??????????????????????????????????????????????????????????????????κγ??????з???????????£??????????????????????????????????????????
????C#??????в??????????????????????????????????????й?????(??ι?????????????????)?????(????????????Щ???????з??)??????????????????????????????????????????????????????????????????????????????????????????????????????Щ??????.NET ????????????????????VB.NET???????????VB.NET???????????????
????????????л????????????????????η????????????????????????????????????????????????е????????????????????е????????????????η???????????????????
????????IDisposable?????????????????????????????з???Dispose()????????????IDisposable????C#?У???????????????IDisposable??
????class SomeClass : IDisposable
????{
????// this class MUST contain an implementation of the
????// IDisposable.Dispose() method?? otherwise
????// you get a compilation error
????public void Dispose()
????{
????// implementation of Dispose() method
????}
????// rest of class
????}
??????????????У????SomeClass??????IDisposable????????????IDisposable??????????Dispose()???????????????????????????????????IDisposable?????????????????????????????????????IDisposable??Dispose() ???????????????????????????SomeClass???IDisposable?????
????C#????????
????IDisposable????????????????????????????????????????????????????
???????????????????C#?е?foreach???????????foreach????????????????????????????????????? System.Collections.IEnumerable??????????C#??????????IL????????????????????????????е?????????foreach?????????????
????????????????????C#?????????????????