void InsertToolboxItemAttributes(WidgetParser parser, CodeRefactorer cref) { Dictionary <string, IType> tb_items = parser.GetToolboxItems(); foreach (string clsname in ObjectNames) { if (tb_items.ContainsKey(clsname)) { continue; } IType cls = parser.GetClass(clsname); if (cls == null) { continue; } cref.AddAttribute(cls, "System.ComponentModel.ToolboxItem", true); XmlElement elem = DocumentElement.SelectSingleNode("object[@type='" + clsname + "']") as XmlElement; if (elem != null && elem.HasAttribute("palette-category")) { cref.AddAttribute(cls, "System.ComponentModel.Category", elem.GetAttribute("palette-category")); } } }