public void Remove(string name) { PaletteRegistryEntry paletteRegistryEntry = this[name]; if (paletteRegistryEntry == null) { return; } this.paletteRegistryEntries.Remove(paletteRegistryEntry); this.WorkspaceService.RemoveCommand(paletteRegistryEntry.CommandName); }
public PaletteRegistryEntry Add(string name, FrameworkElement content, string caption, KeyBinding keyBinding, ExpressionViewProperties viewProperties) { PaletteRegistryEntry paletteRegistryEntry = new PaletteRegistryEntry(this, name, content, caption, keyBinding, viewProperties); this.paletteRegistryEntries.Add(paletteRegistryEntry); if (this.WorkspaceService != null) { this.WorkspaceService.AddCommand(paletteRegistryEntry.CommandName, (Microsoft.Expression.Framework.Commands.ICommand) new PaletteRegistry.ShowPaletteCommand(paletteRegistryEntry)); } this.paletteRegistryEntries.Sort(new Comparison <PaletteRegistryEntry>(this.ComparePaletteRegistryEntries)); return(paletteRegistryEntry); }
public ShowPaletteCommand(PaletteRegistryEntry paletteRegistryEntry) { this.paletteRegistryEntry = paletteRegistryEntry; }
private int ComparePaletteRegistryEntries(PaletteRegistryEntry x, PaletteRegistryEntry y) { return(string.Compare(x.Caption, y.Caption, StringComparison.CurrentCultureIgnoreCase)); }