예제 #1
0
        public static ConfiguredCommand FromType <TCommand>(string name, bool isDefaultCommand = false)
            where TCommand : class, ICommand
        {
            var settingsType = ConfigurationHelper.GetSettingsType(typeof(TCommand));

            if (settingsType == null)
            {
                throw RuntimeException.CouldNotGetSettingsType(typeof(TCommand));
            }

            return(new ConfiguredCommand(name, typeof(TCommand), settingsType, null, isDefaultCommand));
        }