| 1234567891011121314151617181920212223242526272829303132333435 |
- 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<string>();
- 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;
- }
- }
|