Пример #1
0
        //自动匹配符号,递归调用
        private void AutoMatchRender(DevComponents.AdvTree.Node pNode, XmlDocument pXmldoc)
        {
            Exception eError = null;

            if (pNode == null)
            {
                return;
            }
            //获取xml节点名称
            string strtag      = pNode.Tag.ToString();
            string strNodeName = strtag;

            //如果是数据集节点,需处理一下,tag赋值后会有变动
            if (strtag.Contains("DataDIR"))
            {
                strNodeName = "DataDIR";
            }
            switch (strNodeName)
            {
            case "Root":
            case "DIR":
            case "DataDIR":
            {
                if (pNode.Nodes.Count > 0)
                {
                    for (int i = 0; i < pNode.Nodes.Count; i++)
                    {
                        DevComponents.AdvTree.Node pTmpnode = pNode.Nodes[i];
                        AutoMatchRender(pTmpnode, pXmldoc);
                    }
                    //string strNodeKey = pNode.Name;
                    //XmlNode pNewXmlNode = pXmldoc.SelectSingleNode("//" + strNodeName + "[@NodeKey='" + strNodeKey + "']");
                    //if (pNewXmlNode != null)
                    //{
                    //    pNode.DataKey = pNewXmlNode as object;
                    //}
                }
            }
            break;

            case "Layer":
            {
                //获取xml中对应节点
                ModuleMap.AutoMatchLayerConfig(_tmpWorkspace, pNode, pXmldoc, this.chkAutoMatchScale.Checked, this.chkAutoMatchRender.Checked, this.chkAutoMatchLabel.Checked, this.chkAutoMatchFilter.Checked);
            }
            break;
            }
        }