コード例 #1
0
        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());
        }
コード例 #2
0
        /// <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 = "",
            };
        }