protected bool LoadPattern(string str, int lineNbr) { Clear(); LineNbr = lineNbr; int linestart = 0; for (int i = 0; i < str.Length; i++) { char c = str[i]; if ((c == 13) || (c == 10)) // newline or carriage return { string lLine = str.Substring(linestart, i - linestart); if (!LoadByLine(lLine)) { return(false); } // reset for next line linestart = i + 1; } } FlipOnXAxis(); PatternCompiled = new PatternCompiled(this); if (PatternCompiled.IsError()) { return(SetErrorMessage(PatternCompiled)); } return(true); }
protected bool LoadPattern(string str, int lineNbr) { Clear(); LineNbr = lineNbr; int linestart = 0; for (int i = 0; i < str.Length; i++) { char c = str[i]; if ((c == 13) || (c == 10)) // newline or carriage return { string lLine = str.Substring(linestart, i - linestart); if (!LoadByLine(lLine)) return false; // reset for next line linestart = i + 1; } } FlipOnXAxis(); PatternCompiled = new PatternCompiled(this); if (PatternCompiled.IsError()) return SetErrorMessage(PatternCompiled); return true; }