/// <summary> /// Adds commands from type. /// </summary> /// <param name="commandSet">Command Set to add.</param> /// <param name="type">Type to add commands for.</param> public static void AddCommandsFromType(IMDbgCommandCollection commandSet, Type type) { foreach (MethodInfo mi in type.GetMethods()) { object[] attribs = mi.GetCustomAttributes(typeof(CommandDescriptionAttribute), false); if (attribs != null) { foreach (object o in attribs) { if (o is CommandDescriptionAttribute) { var cmd = new MDbgAttributeDefinedCommand(mi, (CommandDescriptionAttribute)o); Debug.Assert(cmd != null); commandSet.Add(cmd); } } } } }
/// <summary> /// Adds commands from type. /// </summary> /// <param name="commandSet">Command Set to add.</param> /// <param name="type">Type to add commands for.</param> public static void AddCommandsFromType(IMDbgCommandCollection commandSet, Type type) { foreach (MethodInfo mi in type.GetMethods()) { object[] attribs = mi.GetCustomAttributes(typeof (CommandDescriptionAttribute), false); if (attribs != null) { foreach (object o in attribs) { if (o is CommandDescriptionAttribute) { var cmd = new MDbgAttributeDefinedCommand(mi, (CommandDescriptionAttribute) o); Debug.Assert(cmd != null); commandSet.Add(cmd); } } } } }