using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using TeamAAS.Core; namespace Plugins.Feeder.Core { public class FeederNameConverter : StringConverter { public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true; public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { var names = new List(); try { var mgr = CoreManager.Feeder; if (mgr != null) { names = mgr.GetAll() .Select(f => f.FeederName) .Where(n => !string.IsNullOrEmpty(n)) .Distinct() .OrderBy(n => n) .ToList(); } } catch { } return new StandardValuesCollection(names); } public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => false; } }