Esempio n. 1
0
        protected override object getPropHighlightValue(IDeviceProperty prop)
        {
            if (prop is ColorProperty)// && this.ColorValue.ColorsEqual(_Color.Black))
            {
                return(LumosColor.HIGHLIGHT_VALUE);
            }

            if (prop is DimmerProperty)
            {
                return(100.0);
            }

            return(base.getPropHighlightValue(prop));
        }
Esempio n. 2
0
        protected override object getPropBlackoutValue(IDeviceProperty prop)
        {
            if (prop is ColorProperty)
            {
                return(LumosColor.BLACKOUT_VALUE);
            }

            if (prop is DimmerProperty)
            {
                return(0.0);
            }

            return(base.getPropBlackoutValue(prop));
        }
Esempio n. 3
0
        /// <summary>
        /// Obtiene una referencia a un objeto que implementa la interfaz <see cref="IDeviceProperty"/>, representa el valor de la propiedad especificada mediante su clave por el parámetro <c>propertyKey</c>.
        /// </summary>
        /// <param name="propertyKey">Clave de la propiedad a obtener.</param>
        /// <param name="registryKey">Clave del registro desde donde recuperar la información.</param>
        /// <returns>
        /// Interfaz que representa el valor de la propiedad.
        /// </returns>
        private IDeviceProperty GetTypedProperty(PropertyKey propertyKey, RegistryKey registryKey = null)
        {
            if (registryKey != null)
            {
                if (registryEntryKeysCollection == null)
                {
                    string[] keyNamesArray = registryKey.GetValueNames();
                    registryEntryKeysCollection = new List <string>(keyNamesArray);
                }
            }

            object          propertyValue    = GetValueTypedProperty(propertyKey, registryKey);
            IDeviceProperty newTypedProperty = DevicePropertyFactory.CreateTypedDeviceProperty(propertyKey, propertyValue);

            return(newTypedProperty);
        }
Esempio n. 4
0
        protected override PropertyHandlerWorker getPropertyWorker(IDeviceProperty prop)
        {
            if (prop is ColorProperty)
            {
                return(new PropertyHandlerWorker(handleColorValue));
            }
            if (prop is DimmerProperty)
            {
                return(new PropertyHandlerWorker(handleDimmerValue));
            }
            if (prop is StrobeProperty)
            {
                return(new PropertyHandlerWorker(handleStrobeValue));
            }

            return(null);
        }
Esempio n. 5
0
        protected override IPropertyType getPropTypeInstance(IDeviceProperty prop)
        {
            if (prop is ColorProperty)
            {
                return new ColorType()
                       {
                           ColorValue = LumosColor.White
                       }
            }
            ;
            if (prop is DimmerProperty)
            {
                return(new IntensityType <double>(0.0, 100.0));
            }
            if (prop is StrobeProperty)
            {
                return(new StrobeType(StrobeEmulator.EMULATOR_MIN, StrobeEmulator.EMULATOR_MAX));
            }

            return(null);
        }
Esempio n. 6
0
 public DeviceViewModel(ITypeDevice typeDevice, IDeviceProperty deviceProperty)
 {
     this.typeDevice     = typeDevice;
     this.deviceProperty = deviceProperty;
     Initialize();
 }