static string FormatItemInfo(SystemMenuItemInfo info) { return($@"Id: {info.Id} Text: {info.Text} Type: {info.Type} Checked: {info.Checked} Enabled: {info.Enabled} Shortcut: {TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString((Keys)info.Shortcut)} ParentMenuHandle: {info.ParentMenuHandle} SubMenuHandle: {info.SubMenuHandle}"); }
void WriteItemInfo(SystemMenuItemInfo info) { WriteMessage(info == null ? "项不存在!" : FormatItemInfo(info)); }