コード例 #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);
        }