Example #1
0
        /// <summary>
        /// Checks if the current Spectrum model of the project in compatible with the
        /// specified model type
        /// </summary>
        /// <param name="type">Model type</param>
        /// <returns>
        /// True, if the project's Spectrum model is compatible with the specified one;
        /// otherwise, false
        /// </returns>
        public static bool IsCurrentModelCompatibleWith(SpectrumModelType type)
        {
            var modelName = Default.CodeDiscoverySolution?.CurrentProject?.ModelName;

            switch (type)
            {
            case SpectrumModelType.Next:
                return(modelName == SpectrumModels.ZX_SPECTRUM_NEXT);

            case SpectrumModelType.SpectrumP3:
                return(modelName == SpectrumModels.ZX_SPECTRUM_P3_E ||
                       modelName == SpectrumModels.ZX_SPECTRUM_NEXT);

            case SpectrumModelType.Spectrum128:
                return(modelName == SpectrumModels.ZX_SPECTRUM_128 ||
                       modelName == SpectrumModels.ZX_SPECTRUM_P3_E ||
                       modelName == SpectrumModels.ZX_SPECTRUM_NEXT);

            case SpectrumModelType.Spectrum48:
                return(true);

            default:
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// Checks if the current Spectrum model of the project in compatible with the
        /// specified model type
        /// </summary>
        /// <param name="type">Model type</param>
        /// <returns>
        /// True, if the project's Spectrum model is compatible with the specified one;
        /// otherwise, false
        /// </returns>
        public static bool IsCurrentModelCompatibleWith(SpectrumModelType type)
        {
            var modelName = Default.CodeDiscoverySolution?.CurrentProject?.ModelName;

            return(SpectrumModels.IsModelCompatibleWith(modelName, type));
        }