static IC() { var m = typeof(IC).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static); foreach (MethodInfo method in m) { Type t = method.ReturnType; string s = method.Name.Substring(1); int i; if (!int.TryParse(s, System.Globalization.NumberStyles.Number, CultureInfo.InvariantCulture, out i)) { continue; } if (t == typeof(bool)) { Bit.Add(i, (Func <bool>)Delegate.CreateDelegate(typeof(Func <bool>), method)); } else if (t == typeof(int)) { Basic.Add(i, (Func <int>)Delegate.CreateDelegate(typeof(Func <int>), method)); } else if (t == typeof(float)) { Float.Add(i, (Func <float>)Delegate.CreateDelegate(typeof(Func <float>), method)); } } }