예제 #1
0
파일: xml.cs 프로젝트: Sciumo/gaigen
        /// <summary>
        /// Parses the attributes of the XML_FLOAT_TYPE element
        /// </summary>
        private static void ParseFloatTypeAttributes(Specification S, XmlAttributeCollection A)
        {
            String floatType = "", floatSuffix = "", floatPrefix = "";
            for (int i = 0; i < A.Count; i++)
            {
                switch (A[i].Name)
                {
                    case XML_TYPE:
                        floatType = A[i].Value;
                        break;
                    case XML_PREFIX:
                        floatPrefix = A[i].Value;
                        break;
                    case XML_SUFFIX:
                        floatSuffix = A[i].Value;
                        break;
                    default:
                        throw new G25.UserException("XML parsing error: Unknown attribute '" + A[i].Name + "' in element '" + XML_FLOAT_TYPE + "'.");
                }
            }

            S.AddFloatType(floatType, floatPrefix, floatSuffix);
        }