| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using TeamAAS.Core;
- namespace Plugins.Feeder.Core
- {
- public class SequenceNameConverter : 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)
- {
- foreach (var feeder in mgr.GetAll())
- {
- foreach (var seq in feeder.Sequences)
- {
- if (!string.IsNullOrEmpty(seq.Name))
- names.Add($"{feeder.FeederName}/{seq.Name}");
- }
- }
- names = names.Distinct().OrderBy(n => n).ToList();
- }
- }
- catch { }
- return new StandardValuesCollection(names);
- }
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => false;
- }
- }
|