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); }
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); }