static void ValidatePostprocessor <T>(IPostProcessor instance) { if (Postprocessors.Any(p => p.GetType() == typeof(T))) { throw new InvalidOperationException(string.Format("Can't add multiple postprocessors of type: {0}", typeof(T).FullName)); } }
public IEnumerable <string> GetActiveProcessorNames() => Postprocessors .Where(pp => pp.Value != null) .OrderBy(pp => pp.Value) .Select(pp => pp.Key);
public static void RegisterPostprocessor <T>(T instance) where T : IPostProcessor { ValidatePostprocessor <T>(instance); Postprocessors.Add(instance); }