aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryMaterialsHelper.cs
blob: 86704a2fdf67d8da6f00b22f169f2298e87d0862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.EmbroideryUI
{
    public static class EmbroideryMaterialsHelper
    {
        public static List<IEmbroideryMaterial> GetAvailableEmbroideryMaterials()
        {
            List<IEmbroideryMaterial> materials = new List<IEmbroideryMaterial>();

            foreach (var type in typeof(IEmbroideryMaterial).Assembly.GetTypes().Where(x => typeof(IEmbroideryMaterial).IsAssignableFrom(x) && !x.IsAbstract))
            {
                materials.Add(Activator.CreateInstance(type) as IEmbroideryMaterial);
            }

            return materials;
        }
    }
}