BitOrchestra.MainForm._ParseSelected C# (CSharp) Method

_ParseSelected() private method

Tries parsing the selected contents of this form, displaying the appropriate messages on failure.
private _ParseSelected ( Expression &Expression, SoundOptions &Options ) : bool
Expression Expression
Options SoundOptions
return bool
        private bool _ParseSelected(out Expression Expression, out SoundOptions Options)
        {
            Expression = null;
            Options = null;
            int targetindex = this._Text.SelectionStart;
            int targetlength = this._Text.SelectionLength;
            int errorindex = targetindex;
            if (targetlength > 0 && Parser.Parse(this._Text.Text, targetindex, targetlength, out Expression, out Options, out errorindex))
            {
                return true;
            }
            else
            {
                this._Text.Select(errorindex, 0);
                return false;
            }
        }