public static bool IsCapable(this Connector connector, Type productName) { if (connector.ConnectorType == ConnectorTypes.DimmerPassZero) { return(false); } BusinessProduct product = (BusinessProduct)Activator.CreateInstance(productName); return(connector.ConnectorType == product.GetConnectorType()); }
/// <summary> /// Connect without checks the connector with the list of homeDevice /// </summary> /// <param name="connector"></param> /// <param name="typeProduct"></param> public static void LinkHomeDevice(this Connector connector, Type typeProduct) { BusinessProduct product = BusinessProduct.GetProduct(typeProduct); connector.HomeDevices = product.GetInstanceProducts(); connector.Product = new Product { TypeProduct = typeProduct.Name, NameProduct = "", }; }