예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectMapTable"/> class.
        /// </summary>
        /// <param name="bufferedReader">The buffered reader.</param>
        public ObjectMapTable(TextReader bufferedReader)
            : this()
        {
            try
            {
                XmlDocument XmlData = new XmlDocument();
                XmlData.LoadXml(bufferedReader.ReadToEnd());

                //add projects to treeview

                XmlNodeList Classes = XmlData.SelectNodes("ObjectMap/Class");
                if (Classes != null && Classes.Count > 0)
                {
                    foreach (XmlElement nodeClass in Classes)
                    {
                        // Add path and class to the object mapping
                        ObjectMapping theMapping = new ObjectMapping(nodeClass);
                        _objectMapList.Add(theMapping);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("error reading map file", ex);
            }
            finally
            {
                bufferedReader.Close();
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectMapTable"/> class.
        /// </summary>
        /// <param name="bufferedReader">The buffered reader.</param>
        public ObjectMapTable(TextReader bufferedReader)
            : this()
        {
            try
            {
                XmlDocument XmlData = new XmlDocument();
                XmlData.LoadXml(bufferedReader.ReadToEnd());

                //add projects to treeview

                XmlNodeList Classes = XmlData.SelectNodes("ObjectMap/Class");
                if (Classes != null && Classes.Count > 0)
                {
                    foreach (XmlElement nodeClass in Classes)
                    {
                        // Add path and class to the object mapping
                        ObjectMapping theMapping = new ObjectMapping(nodeClass);
                        _objectMapList.Add(theMapping);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("error reading map file", ex);
            }
            finally
            {
                bufferedReader.Close();
            }
        }