Ejemplo n.º 1
0
        /// <summary>
        /// Creates an instance of <see cref="ConfigurableLtoFlashIntellivisionIICompatibilityFeature"/>.
        /// </summary>
        /// <param name="readOnly">If <c>true</c>, the feature is read-only and will throw a <see cref="System.InvalidOperationException"/> if modified.</param>
        /// <returns>A new configurable LTO Flash! feature.</returns>
        public static IConfigurableLtoFlashFeature Create(bool readOnly)
        {
            IConfigurableLtoFlashFeature configurableFeature;

            if (readOnly)
            {
                configurableFeature = Default.Value;
            }
            else
            {
                configurableFeature = new ConfigurableLtoFlashIntellivisionIICompatibilityFeature();
            }
            return(configurableFeature);
        }
        private static Dictionary <string, IConfigurableLtoFlashFeature> InitializeConfigurableFeatures(bool readOnly)
        {
            var configurableFeatures = new IConfigurableLtoFlashFeature[]
            {
                ConfigurableLtoFlashEcsCompatibilityFeature.Create(readOnly),
                ConfigurableLtoFlashIntellivisionIICompatibilityFeature.Create(readOnly),
                ConfigurableLtoFlashShowTitleScreenFeature.Create(readOnly),
                ConfigurableLtoFlashSaveMenuPositionFeature.Create(readOnly),
                ConfigurableLtoFlashBooleanFeature.Create(Device.BackgroundGCPropertyName, Resources.Strings.SetBackgroundGarbageCollectCommand_Name, true, DeviceStatusFlags.BackgroundGC, readOnly),
                ConfigurableLtoFlashBooleanFeature.Create(Device.KeyclicksPropertyName, Resources.Strings.SetKeyclicksCommand_Name, false, DeviceStatusFlags.Keyclicks, readOnly),
                ConfigurableLtoFlashBooleanFeature.Create(Device.EnableConfigMenuOnCartPropertyName, Resources.Strings.SetEnableConfigMenuOnCartCommand_Name, true, DeviceStatusFlags.EnableCartConfig, readOnly),
                ConfigurableLtoFlashBooleanFeature.Create(Device.ZeroLtoFlashRamPropertyName, Resources.Strings.SetRandomizeLtoFlashRamCommand_Name, true, DeviceStatusFlags.ZeroRamBeforeLoad, readOnly),
            };
            var configurableFeaturesDictionary = configurableFeatures.ToDictionary(f => f.UniqueId);

            return(configurableFeaturesDictionary);
        }