Пример #1
0
		public void Load(string[] lines)
		{
			_lastnoPrefixCommand = null;

			foreach(var line in lines)
			{
				_stream.Line = line;
				if (!Command())
				{
					Commands.Clear();
					break;
				}
			}

			PostLoad();

		}
Пример #2
0
        public override void Load()
        {
			PreLoad();

			_lastnoPrefixCommand = null;

            using (StreamReader sr = new StreamReader(LoadOptions.FileName))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    _stream.Line = line;
                    if (!Command())
                    {
                        Commands.Clear();
                        break;
                    }
                }
            }

			PostLoad();
		}
Пример #3
0
        private bool ReadGCommand()
        {
            _stream.Next();

            string cmdname = "G" + _stream.ReadDigits();
            _stream.SkipSpaces();

            Command cmd = CommandFactory.Create(cmdname);

            if (cmd != null)
            {
                if (cmd.UseWithoutPrefix)
                    _lastnoPrefixCommand = cmd;

                Commands.AddCommand(cmd);
                if (!cmd.ReadFrom(_stream))
                    return false;
            }
            else
            {
                if (!AddGxxMxxCommand(CommandFactory.Create("GXX"), cmdname))
                    return false;
            }

            return true;
        }
Пример #4
0
        private bool AddGxxMxxCommand(Command cmd, string cmdname)
        {
            cmd.SetCode(cmdname);

            Commands.AddCommand(cmd);
            if (!cmd.ReadFrom(_stream))
                return false;

            return true;
        }