Esempio n. 1
0
        public void ValidateFile(Stream stream, TextWriter outstream, Action<int> progress, Action<string> status)
        {
            try {
                MZTabErrorList errorList = new MZTabErrorList(Level.Info);

                try {
                    validate(stream, outstream, errorList, progress, status);
                    //refine();
                } catch (MZTabException e) {
                    outstream.Write(MZTabProperties.MZTabExceptionMessage);
                    errorList.Add(e.Error);
                } catch (MZTabErrorOverflowException) {
                    outstream.Write(MZTabProperties.MZTabErrorOverflowExceptionMessage);
                }

                errorList.print(outstream);
                if (errorList.IsNullOrEmpty()) {
                    outstream.Write("No errors in this section!" + MZTabConstants.NEW_LINE);
                }

                outstream.Close();
                //stream.Close();
            } catch (Exception e) {
                MessageBox.Show(e.Message, e.StackTrace);
            }
        }
        public MZTabFileParser(string tabFile, TextWriter outstream, Level level)
        {
            init(tabFile);

            try{
                errorList = new MZTabErrorList(level);
                check();
                refine();
            }
            catch (MZTabException e){
                outstream.Write(MZTabProperties.MZTabExceptionMessage);
                errorList.Add(e.Error);
            }
            catch (MZTabErrorOverflowException){
                outstream.Write(MZTabProperties.MZTabErrorOverflowExceptionMessage);
            }

            errorList.print(outstream);
            if (errorList.IsNullOrEmpty()){
                outstream.Write("not errors in " + tabFile + " file!" + MZTabConstants.NEW_LINE);
            }
        }