Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests pass after reformat, full solution builds 0 errors. Added .csharpierignore so csproj/config XML keeps its existing layout (CSharpier's XML wrapping churns attributes with zero benefit). Formatting is now enforceable: dotnet csharpier check . passes.
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
|
|
namespace OpenNest.Posts.Cincinnati
|
|
{
|
|
public sealed class MaterialLibraryNameConverter : StringConverter
|
|
{
|
|
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true;
|
|
|
|
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => false;
|
|
|
|
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
|
{
|
|
var config = context?.Instance as CincinnatiPostConfig;
|
|
var names = new List<string> { "" };
|
|
|
|
if (config?.MaterialLibraries != null)
|
|
{
|
|
names.AddRange(
|
|
config
|
|
.MaterialLibraries.Select(e => e.Library)
|
|
.Where(s => !string.IsNullOrWhiteSpace(s))
|
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
|
.OrderBy(s => s, StringComparer.OrdinalIgnoreCase)
|
|
);
|
|
}
|
|
|
|
return new StandardValuesCollection(names);
|
|
}
|
|
}
|
|
}
|