c6f544c5d7
Replaces the material textbox on EditNestInfoForm with a combobox whose items are aggregated from every loaded post processor that implements the new IMaterialProvidingPostProcessor interface. CincinnatiPostProcessor exposes its configured MaterialLibraries entries. Free-text entry still works so custom materials remain usable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
803 B
C#
31 lines
803 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace OpenNest
|
|
{
|
|
public static class PostProcessorMaterials
|
|
{
|
|
private static readonly List<string> materials = new();
|
|
|
|
public static IReadOnlyList<string> Names => materials;
|
|
|
|
public static void AddFrom(IMaterialProvidingPostProcessor provider)
|
|
{
|
|
if (provider == null)
|
|
return;
|
|
|
|
foreach (var name in provider.GetMaterialNames())
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(name)
|
|
&& !materials.Contains(name, StringComparer.OrdinalIgnoreCase))
|
|
{
|
|
materials.Add(name);
|
|
}
|
|
}
|
|
|
|
materials.Sort(StringComparer.OrdinalIgnoreCase);
|
|
}
|
|
}
|
|
}
|