0x01 :序言 I leave uncultivated today, was precisely yestoday perishes tomorrow which the person of the body implored “看不清楚的时光印痕,像是泛黄的底片,明明还记得那个故事,却忘了故事里的风月”,不知如今因为生成规则.词法排序或效率而争执地面红耳赤的少年们,多少岁月走过重新翻阅看着七零八落的注释和代码段,是否只得慨叹岁月这把最锋利的杀猪刀,然而,即便最终能停留在代码段的注释行不过寥
Supposed we have a class below public class TestHash { public int x; int y; public TestHash(int x, int y) { this.x = x; this.y = y; } public override int GetHashCode() { Console.WriteLine("判断hashcode"); return x + y; } public override bool Equal
using System; using System.Collections.Generic; using System.Text; using Microsoft.Win32; using System.Threading; using System.IO; using System.Security.Cryptography; using Common; namespace ConsoleApplication2 { public class Test { private string _i
公司里遗留下了相当多的 Enum.GetHashCode()来获取枚举值的代码 但是这会产生装箱行为的!!因为Enum是值类型,GetHashCode()是Object的方法,调用GetHashCode必定要装箱成Object类型才能调用 同理:Enum.ToString()也会装箱 用 Enum.GetName( typeof (Color), color);//推荐 namespace EnumBoxTest{ class Program { enum Color { None=0, Red