/// <inheritdoc /> public override void Initialize(ProgramFeatures features) { base.Initialize(features); _intellivisionII = IntellivisionIIOptions.FirstOrDefault(n => n.Flags == (uint)features.IntellivisionII); _superVideoArcade = SuperVideoArcadeOptions.FirstOrDefault(p => p.Flags == (uint)features.SuperVideoArcade); _tutorvision = TutorvisionOptions.FirstOrDefault(p => (p != null) && (p.Flags == (uint)features.Tutorvision)); RaiseAllPropertiesChanged(); }
/// <inheritdoc /> public override void Initialize(ProgramFeatures features) { base.Initialize(features); _ntsc = NtscOptions.FirstOrDefault(n => n.Flags == (uint)features.Ntsc); _pal = PalOptions.FirstOrDefault(p => p.Flags == (uint)features.Pal); _intellivoice = IntellivoiceOptions.FirstOrDefault(p => (p != null) && (p.Flags == (uint)features.Intellivoice)); RaiseAllPropertiesChanged(); }
public override void Initialize(ProgramFeatures features) { base.Initialize(features); _acceleration = AccelerationOptions.FirstOrDefault(e => (e != null) && (e.Flags == ((uint)features.LtoFlash & FeatureCompatibilityHelpers.CompatibilityMask))); _usesFlashStorage = features.LtoFlash.HasFlag(LtoFlashFeatures.SaveDataOptional) || features.LtoFlash.HasFlag(LtoFlashFeatures.SaveDataRequired); _flashStorage = FlashStorageOptions.FirstOrDefault(e => UsesFlashStorage && (e != null) && features.LtoFlash.HasFlag((LtoFlashFeatures)e.Flags)); _usesSerialPort = features.LtoFlash.HasFlag(LtoFlashFeatures.UsbPortEnhanced) || features.LtoFlash.HasFlag(LtoFlashFeatures.UsbPortRequired); _serialPort = SerialPortOptions.FirstOrDefault(s => UsesSerialPort && (s != null) && features.LtoFlash.HasFlag((LtoFlashFeatures)s.Flags)); RaiseAllPropertiesChanged(); UpdateEnableStates(); }
/// <inheritdoc /> public override void Initialize(ProgramFeatures features) { base.Initialize(features); _keyboardComponent = KeyboardComponentOptions.FirstOrDefault(e => (e != null) && (e.Flags == ((uint)features.KeyboardComponent & FeatureCompatibilityHelpers.CompatibilityMask))); _usesMicrophone = features.KeyboardComponent.HasFlag(KeyboardComponentFeatures.Microphone); _usesPrinter = features.KeyboardComponent.HasFlag(KeyboardComponentFeatures.Printer); _usesCassette = features.KeyboardComponent.HasFlag(KeyboardComponentFeatures.TapeOptional) || features.KeyboardComponent.HasFlag(KeyboardComponentFeatures.TapeRequired); _cassette = CassetteOptions.FirstOrDefault(s => s.Flags == (uint)(features.KeyboardComponent & KeyboardComponentFeaturesHelpers.TapeMask)); _basic = BasicOptions.FirstOrDefault(s => s.Flags == (uint)(features.KeyboardComponent & KeyboardComponentFeaturesHelpers.BasicMask)); RaiseAllPropertiesChanged(); UpdateCompatibility((KeyboardComponentFeatures)_keyboardComponent.Flags); }
/// <summary> /// Helper method to encapsulate raising the value change event, assign new value, and update feature bits. /// </summary> /// <param name="propertyName">Name of the property being updated for INotifyPropertyChanged.</param> /// <param name="newValue">The new value for the property.</param> /// <param name="currentValue">The current value, which will be assigned a new value.</param> /// <param name="customAction">A custom action to execute after property update occurs.</param> protected void UpdateFeatureProperty(string propertyName, ProgramFeatureImageViewModel newValue, ref ProgramFeatureImageViewModel currentValue, Action <string, ProgramFeatureImageViewModel> customAction) { if (currentValue != null) { Features.UpdateFeatureBits(currentValue.Category, currentValue.Flags, false); } if (newValue != null) { Features.UpdateFeatureBits(newValue.Category, newValue.Flags, true); } this.AssignAndUpdateProperty(PropertyChanged, propertyName, newValue, ref currentValue, customAction); }
/// <inheritdoc /> public override void Initialize(ProgramFeatures features) { base.Initialize(features); _ecs = EcsOptions.FirstOrDefault(e => (e != null) && (e.Flags == ((uint)features.Ecs & FeatureCompatibilityHelpers.CompatibilityMask))); _usesCassette = features.Ecs.HasFlag(EcsFeatures.Tape); _usesSynthesizer = features.Ecs.HasFlag(EcsFeatures.Synthesizer); _usesPrinter = features.Ecs.HasFlag(EcsFeatures.Printer); _usesSerialPort = features.Ecs.HasFlag(EcsFeatures.SerialPortEnhanced) || features.Ecs.HasFlag(EcsFeatures.SerialPortRequired); _serialPort = SerialPortOptions.FirstOrDefault(s => UsesSerialPort && (s != null) && features.Ecs.HasFlag((EcsFeatures)s.Flags)); RaiseAllPropertiesChanged(); UpdateCompatibility((EcsFeatures)_ecs.Flags); UpdateSerialPortOptions(_usesSerialPort); }
/// <summary> /// Initializes a new instance of the JlpFeaturesConfigurationPageViewModel type. /// </summary> public JlpFeaturesConfigurationPageViewModel() { var versions = new List <ProgramFeatureImageViewModel>(); foreach (var versionImageEntry in VersionImages) { var image = string.IsNullOrEmpty(versionImageEntry.Value) ? null : typeof(JlpFeaturesConfigurationPageViewModel).LoadImageResource(versionImageEntry.Value); var viewModel = new ProgramFeatureImageViewModel(versionImageEntry.Key.ToDisplayString(), image, null, FeatureCategory.Jlp, (uint)versionImageEntry.Key); versions.Add(viewModel); } JlpVersions = new ObservableCollection <ProgramFeatureImageViewModel>(versions); var selectableOptions = new[] { JlpFeatures.SerialPortEnhanced, JlpFeatures.SerialPortRequired }; SerialPortOptions = new ObservableCollection <ProgramFeatureImageViewModel>(selectableOptions.ToFeatureViewModels(JlpFeatureSet.Data)); }
/// <inheritdoc /> public override void Initialize(ProgramFeatures features) { base.Initialize(features); _jlpVersion = JlpVersions.FirstOrDefault(e => (e != null) && e.Flags == (uint)features.JlpHardwareVersion); _enableAcceleratorsAtStartup = features.Jlp.HasFlag(JlpFeatures.Tolerates); _usesFlashStorage = features.Jlp.HasFlag(JlpFeatures.SaveDataOptional) || features.Jlp.HasFlag(JlpFeatures.SaveDataRequired); _minimumFlashSectors = features.JlpFlashMinimumSaveSectors; _usesSerialPort = features.Jlp.HasFlag(JlpFeatures.SerialPortEnhanced) || features.Jlp.HasFlag(JlpFeatures.SerialPortRequired); _serialPort = SerialPortOptions.FirstOrDefault(s => UsesSerialPort && (s != null) && features.Jlp.HasFlag((JlpFeatures)s.Flags)); _usesLEDs = features.Jlp.HasFlag(JlpFeatures.UsesLEDs); RaiseAllPropertiesChanged(); UpdateUsesFlashStorage(_usesFlashStorage); UpdateSerialPortUsage(_usesSerialPort); UpdateFlashUsageLevel(_minimumFlashSectors); }
/// <summary> /// Helper method to encapsulate raising the value change event, assign new value, and update feature bits. /// </summary> /// <param name="propertyName">Name of the property being updated for INotifyPropertyChanged.</param> /// <param name="newValue">The new value for the property.</param> /// <param name="currentValue">The current value, which will be assigned a new value.</param> protected void UpdateFeatureProperty(string propertyName, ProgramFeatureImageViewModel newValue, ref ProgramFeatureImageViewModel currentValue) { UpdateFeatureProperty(propertyName, newValue, ref currentValue, null); }