예제 #1
0
        public void Remove(string name)
        {
            PaletteRegistryEntry paletteRegistryEntry = this[name];

            if (paletteRegistryEntry == null)
            {
                return;
            }
            this.paletteRegistryEntries.Remove(paletteRegistryEntry);
            this.WorkspaceService.RemoveCommand(paletteRegistryEntry.CommandName);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public ShowPaletteCommand(PaletteRegistryEntry paletteRegistryEntry)
 {
     this.paletteRegistryEntry = paletteRegistryEntry;
 }
예제 #4
0
 private int ComparePaletteRegistryEntries(PaletteRegistryEntry x, PaletteRegistryEntry y)
 {
     return(string.Compare(x.Caption, y.Caption, StringComparison.CurrentCultureIgnoreCase));
 }