随笔分类 - C# Nutshell
知识来源:http://www.albahari.com/nutshell/code.aspx
Disposal and Garbage Collection(资源释放处理与垃圾回收)
摘要:来源地址:http://www.albahari.com/nutshell/cs4ch12.aspxCalling Dispose from a finalizer(采用完成执行后的释放,也就是析构函数):class Test : IDisposable{ public void Dispose() // NOT virtual(非虚函数) { Dispose (true); GC.SuppressFinalize (this); // Prevent finalizer from running.(在执行过程中防止调用最终的资源释放函数) }...
阅读全文
c#4.0 Other XML Technologies(一些XML的知识点)
摘要:URI:http://www.albahari.com/nutshell/cs4ch11.aspxEnumerating nodes with XmlReader使用XmlReader阅读器来对节点进行枚举读取<?xml version="1.0" encoding="utf-8" standalone="yes"?><customer id="123" status="archived"> <firstname>Jim</firstname> &
阅读全文
C#4.0 Collections【集合】
摘要:URI:http://www.albahari.com/nutshell/cs4ch07.aspx集合:Implementing IEnumerable<T> with an iterator(实现IEnumerable<T>的迭代器):public class MyGenCollection : IEnumerable<int>{ int[] data = {1, 2, 3}; public IEnumerator<int> GetEnumerator() { foreach (int i in data) yield return i; }
阅读全文
浙公网安备 33010602011771号