Group the Cincinnati and GravographIS plugin projects in a Posts/ folder so new machine posts have one home. Project names, namespaces, and the runtime Posts/ deploy target are unchanged; only relative paths in the solution and project references move.
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);
|
|
}
|
|
}
|
|
}
|