예제 #1
0
        public CustomCommandFeature CreateFeature(string name, string arguments)
        {
            Type match = GetFeatureTypes()
                         .FirstOrDefault(t => CustomCommandFeature.GetName(t).Equals(name, _comparison));

            if (match == null)
            {
                throw new Exception($"The feature '{name}' was not found.");
            }

            var feature = Activator.CreateInstance(match) as CustomCommandFeature;

            feature.FillArguments(arguments);

            return(feature);
        }
예제 #2
0
 public FeatureInfo[] GetFeatureInfos()
 => GetFeatureTypes()
 .Select(feature => new FeatureInfo {
     Name = CustomCommandFeature.GetName(feature), Summary = CustomCommandFeature.GetSummary(feature)
 })
 .ToArray();