コード例 #1
0
        /// <summary>
        /// Creates an instance of <see cref="ConfigurableLtoFlashSaveMenuPositionFeature"/>.
        /// </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 ConfigurableLtoFlashSaveMenuPositionFeature();
            }
            return(configurableFeature);
        }
コード例 #2
0
        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);
        }