Exemplo n.º 1
0
        private static bool processField(string parts)
        {
            string[] parameters = parts.Split(new char[] { ',' });
            if (parameters.Length != 2)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }

            try
            {
                ParserParameter parserParameter = new ParserParameter((FieldName)Enum.Parse(typeof(FieldName), parameters[0], true), Int32.Parse(parameters[1].Trim()));
                if (parserParameters == null)
                {
                    parserParameters = new Collection <ParserParameter>();
                }
                parserParameters.Add(parserParameter);
            }
            catch (FormatException)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }
            catch (ArithmeticException)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }

            return(true);
        }
Exemplo n.º 2
0
        private static bool processField(string parts)
        {
            string[] parameters = parts.Split(new char[] { ',' });
            if (parameters.Length != 2)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }

            try
            {
                ParserParameter parserParameter = new ParserParameter((FieldName)Enum.Parse(typeof(FieldName), parameters[0], true), Int32.Parse(parameters[1].Trim()));
                if (parserParameters == null)
                    parserParameters = new Collection<ParserParameter>();
                parserParameters.Add(parserParameter);
            }
            catch (FormatException)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }
            catch (ArithmeticException)
            {
                Logger.Instance.Write("MHEG Parser parameters file format error: A Field line is wrong.");
                System.Environment.Exit(3);
            }

            return (true);
        }