Example #1
0
        private void initializeData(String path, DataSet ds)
        {
            _defaultColumnNumber = 0;
            _dataList = new List<Data>();

            _filepath = path;
            _doc = new XmlDocument();
            _doc.Load(_filepath);
            XmlNode root = _doc.DocumentElement;
            XmlNodeList list = root.ChildNodes;

            _DEPTMEAS = new DEPTMEAS();
            _DEPTMEAS.initializeData(ds);

            XmlNode dataNode = list[0];
            XmlNodeList dataList = dataNode.ChildNodes;
            foreach (XmlNode node in dataList)
            {
                String name = "diagram.Common." + node.InnerText;
                Assembly assembly = Assembly.GetAssembly(Type.GetType(name));
                Data d = (Data)assembly.CreateInstance(name);
                d.initializeData(ds);

                _dataList.Add(d);
            }

            XmlNode columnNode = list[1];
            XmlNodeList columnList = columnNode.ChildNodes;
            _defaultColumnNumber = columnList.Count;
            for (int loop = 0; loop < columnList.Count; ++loop)
            {
                XmlNode node = columnList[loop];
                String[] str = node.InnerText.Split(',');
                for (int i = 0; i < str.Length; ++i)
                {
                    String name = str[i];
                    foreach (Data d in _dataList)
                    {
                        if (d.Name == name)
                        {
                            d.DefaultColumnPos.Add(loop+1);
                            break;
                        }
                    }
                }
            }
        }