Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
        }