using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.DI; using Tango.MachineStudio.Common; public static class TangoIOCExtensions { /// /// Gets the specified module view models. /// /// The Tango IOC. /// The module. /// public static IEnumerable GetModuleViewModels(this TangoIOC tangoIOC, IStudioModule module) { var viewModels = tangoIOC.GetAllInstancesByBase().Where(x => x != null && x.GetType().BaseType.GetGenericArguments().Length > 0 && x.GetType().BaseType.GetGenericArguments()[0] == module.GetType()); return viewModels; } }