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)); }
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)); }
/// <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); }
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); }
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); }
public DeviceViewModel(ITypeDevice typeDevice, IDeviceProperty deviceProperty) { this.typeDevice = typeDevice; this.deviceProperty = deviceProperty; Initialize(); }