public void Registrate(ICommand exemplar) { var sketch = new CommandSketch( attribute: ReflectionTools.GetCommandAttributeOrThrow(exemplar.GetType()), commandType: exemplar.GetType(), locator: () => exemplar ); this.Registrate(sketch); }
void Registrate(CommandSketch sketch) { string key = ParseTools.GetCommandName(sketch.CommandType).ToLower(); this.commands.Add(key, sketch); }
void RegistrateUnsafe(Type type, CommandAttribute attribute) { var sketch = new CommandSketch(attribute, type, () => (ICommand)Activator.CreateInstance(type)); this.Registrate(sketch); }