Beispiel #1
0
        public void Registrate(ICommand exemplar)
        {
            var sketch = new CommandSketch(
                attribute:      ReflectionTools.GetCommandAttributeOrThrow(exemplar.GetType()),
                commandType:    exemplar.GetType(),
                locator:        () => exemplar
                );

            this.Registrate(sketch);
        }
Beispiel #2
0
        void Registrate(CommandSketch sketch)
        {
            string key = ParseTools.GetCommandName(sketch.CommandType).ToLower();

            this.commands.Add(key, sketch);
        }
Beispiel #3
0
        void RegistrateUnsafe(Type type, CommandAttribute attribute)
        {
            var sketch = new CommandSketch(attribute, type, () => (ICommand)Activator.CreateInstance(type));

            this.Registrate(sketch);
        }