/// <summary> /// Register a method as a command /// </summary> /// <param name="Instance">The instance to register for</param> /// <param name="Method">The method</param> /// <param name="DefaultParams">Default parameters</param> public static void RegisterCommand(object Instance, MethodInfo Method, object[] DefaultParams = null) { if (Method == null) { return; } string HelpText = Method.Name; foreach (ParameterInfo ParamInfo in Method.GetParameters()) { string ParamString = ParamInfo.ToString(); int DotIndex = ParamString.LastIndexOf(".", StringComparison.Ordinal); if (DotIndex >= 0) { ParamString = ParamString.Substring(DotIndex + 1); } HelpText += " [" + ParamString + "]"; } RegisterCommand(Instance, Method, HelpText, DefaultParams); }
public override int GetHashCode() { return((base.GetHashCodeString() + ConstructType.ToString() + ParamInfo.ToString()).GetHashCode()); }