コード例 #1
0
        private void MarkRequiredIfNeeded()
        {
            var markRequired = (SerialPort != null) && ((EcsFeatures)SerialPort.Flags).HasFlag(EcsFeatures.SerialPortRequired);

            if (markRequired)
            {
                Ecs = EcsOptions.First(e => e.Flags == (uint)EcsFeatures.Requires);
            }
        }
コード例 #2
0
 /// <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);
 }