Пример #1
0
        public override bool EnsureBuilt(
            bool force,
            PcodeSystem.IEvaluationContext pcodeEnvironment,
            BuildFailedCallback failedCallback)
        {
            if (!force && (_scoreEffectSpec != null))
            {
                return(true);
            }
            _scoreEffectSpec = null;

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.EffectSpecListRec LocalEffectSpec;
            Synthesizer.BuildInstrErrors  Error = Synthesizer.BuildScoreEffectList(
                this.Source,
                ((Document)Parent).CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out LocalEffectSpec);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                failedCallback(this, new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine));
                return(false);
            }

            _scoreEffectSpec = LocalEffectSpec;
            return(true);
        }
Пример #2
0
        private bool BuildThis(out Synthesizer.EffectSpecListRec effectSpec)
        {
            effectSpec = null;

            if (!Validate()) // ensure all controls commit data to store
            {
                return(false);
            }

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.BuildInstrErrors Error = Synthesizer.BuildScoreEffectList(
                textBoxEffectBody.Text,
                mainWindow.Document.CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out effectSpec);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                BuildErrorInfo errorInfo = new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine);
                textBoxEffectBody.Focus();
                textBoxEffectBody.SetSelectionLine(ErrorLine - 1);
                textBoxEffectBody.ScrollToSelection();
                MessageBox.Show(errorInfo.CompositeErrorMessage, "Error", MessageBoxButtons.OK);
                return(false);
            }

            return(true);
        }
Пример #3
0
        public override bool EnsureBuilt(
            bool force,
            PcodeSystem.IEvaluationContext pcodeEnvironment,
            BuildFailedCallback failedCallback)
        {
            if (!force && (_instrument != null))
            {
                return(true);
            }
            _instrument = null;

            Synthesizer.InstrumentRec TheInstrument;

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.BuildInstrErrors Error = Synthesizer.BuildInstrumentFromText(
                InstrDefinition,
                ((Document)Parent).CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out TheInstrument);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                failedCallback(this, new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine));
                return(false);
            }

            _instrument = TheInstrument;
            return(true);
        }