public override object GetValue(object component) { CommandMap map = component as CommandMap; if (null == map) { throw new ArgumentException("component is not a CommandMap instance", "component"); } return(map.Commands[this.Name]); }
// Methods public CommandMapDescriptor(ICustomTypeDescriptor descriptor, CommandMap map) : base(descriptor) { this._map = map; }
private void InitCommands() { this._commands = new CommandMap(); this._commands.AddCommand("NewPuzzelCommand", x => this.NewPuzzel()); this._commands.AddCommand("ShowPictureCommand", x => this.ShowPicture()); this._commands.AddCommand("ShowPuzzelCommand", x => this.ShowPuzzel()); this._commands.AddCommand("ReplayPuzzelCommand", x => this.ReplayPuzzel()); this._commands.AddCommand("ShowVideoPuzzel", x => this.ShowVideoPuzzel()); }