/// <summary> /// Adds an item to the palette in the given category</summary> /// <param name="item">Palette item</param> /// <param name="categoryName">Category name</param> /// <param name="client">Client that instantiates item during drag-drop operations</param> public void AddItem(object item, string categoryName, IPaletteClient client) { if (m_objectClients.ContainsKey(item)) { throw new InvalidOperationException("duplicate item"); } if (categoryName != null) { m_objectClients.Add(item, client); m_paletteTreeAdapter.AddItem(item, categoryName); } }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public void GetInfo(object item, ItemInfo info) { info.AllowLabelEdit = false; if (item != this) { string categoryName = item as string; if (categoryName != null && m_categories.ContainsKey(categoryName)) { info.Label = categoryName; } else { IPaletteClient client = m_paletteService.m_objectClients[item]; client.GetInfo(item, info); } } }
/// <summary> /// Adds an item to the palette in the given category</summary> /// <param name="item">Palette item</param> /// <param name="categoryName">Category name</param> /// <param name="client">Client that instantiates item during drag-drop operations</param> public void AddItem(object item, string categoryName, IPaletteClient client) { if (m_objectClients.ContainsKey(item)) throw new InvalidOperationException("duplicate item"); if (categoryName != null) { m_objectClients.Add(item, client); TreeAdapter.AddItem(item, categoryName); } }