コード例 #1
0
 public void Clear()
 {
     _QceVersion = null;
     _ReplaceActivityCollection = new List <CommandReplaceActivity>();
     _LodTempCollection         = new List <CommandLodTemp>();
     _LodFlags = new CommandLodFlags();
 }
コード例 #2
0
        public void Read(string file)
        {
            Clear();

            _Tokenizer = new FileTokenizer(file);

            try
            {
                while (!_Tokenizer.GetToken())
                {
                    switch (_Tokenizer.Token)
                    {
                    case CommandQceVersion.Command:
                        _Tokenizer.GetToken();
                        _QceVersion = new CommandQceVersion(_Tokenizer.Token);
                        break;

                    case CommandReplaceActivity.Command:
                        _Tokenizer.GetToken();
                        CommandReplaceActivity cra = new CommandReplaceActivity();
                        cra.SequenceName = _Tokenizer.Token;
                        _Tokenizer.GetToken();
                        cra.Activity = _Tokenizer.Token;
                        _ReplaceActivityCollection.Add(cra);
                        break;

                    case CommandLodTemp.Command:
                        _Tokenizer.GetToken();
                        CommandLodTemp lodtemp = new CommandLodTemp();
                        lodtemp.Index = Convert.ToInt32(_Tokenizer.Token);
                        _Tokenizer.GetToken();
                        byte count = Convert.ToByte(_Tokenizer.Token);
                        for (byte i = 0; i < count; i++)
                        {
                            _Tokenizer.GetToken();
                            lodtemp.Distances.Add(Convert.ToInt32(_Tokenizer.Token));
                        }
                        _LodTempCollection.Add(lodtemp);
                        break;

                    case CommandLodFlags.Command:
                        _Tokenizer.GetToken();
                        _LodFlags = new CommandLodFlags(Convert.ToInt32(_Tokenizer.Token));
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Messages.ThrowException("Qc.Qce.Read(string)", Messages.LINE + _Tokenizer.Line + ", " + Messages.TOKEN + _Tokenizer.Token + "\n" + e.Message);
            }
        }