void Foo<T>() where T : new(string, int), enum, delegate
obj?.Name = ; //obj为null则什么也不做
public T this<T>[int i] { get { return (T)arr[i]; } set { arr[i] = value; } }
Create<T1, T2>(T1 arg1, T2 arg2) { return new { Item1 = arg1, Item2 = arg2 }; }
, { Use(i); }
Package { static readonly Dictionary<string, int> _dic; static Package() { _dic = new Dictionary<string, int>(3); _dic.Add(, 0); _dic.Add(, 1); _dic.Add(, 2); } [string name] { get { return _dic[name]; } set { _dic[name] = value; } } } // use example Use(Package[]);
暂时就扯这些,有新想法再补上。