Beispiel #1
0
        private static void AddNode(XmlNode inXmlNode, ref XmlMain parUsrService)
        {
            try
            {
                XmlNode     xNode;
                XmlNodeList nodeList;
                int         i;
                if (inXmlNode.Attributes[0].Name == "Name")
                {
                    parUsrService.ModuleName = inXmlNode.Attributes[0].Value;
                }
                if (inXmlNode.HasChildNodes)
                {
                    nodeList = inXmlNode.ChildNodes;
                    for (i = 0; i <= nodeList.Count - 1; i++)
                    {
                        xNode = inXmlNode.ChildNodes[i];
                        if (xNode.Attributes.Count > 1)
                        {
                            for (int j = 0; j < xNode.Attributes.Count; j++)
                            {
                                if (xNode.Attributes[j].Name.ToLower() == "class")
                                {
                                    parUsrService.DummyClassName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "method")
                                {
                                    parUsrService.DummyMethodName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "supernodeclass")
                                {
                                    parUsrService.SuperNodeClass = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "assembly")
                                {
                                    parUsrService.Assembly = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "classname")
                                {
                                    parUsrService.P2PDummyClassName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "methodname")
                                {
                                    parUsrService.P2PDummyMethodName = xNode.Attributes[j].Value;
                                }
                            }
                        }
                        else
                        {
                            try
                            {
                                if (xNode.Attributes[0].Name.ToLower() == "swffilename")
                                {
                                    parUsrService.SWFFileName = xNode.Attributes[0].Value;
                                }
                                if (xNode.Attributes[0].Name.ToLower() == "textfilename")
                                {
                                    parUsrService.TextFileName = xNode.Attributes[0].Value;
                                }
                            }
                            catch (Exception ex)
                            {
                                VMuktiHelper.ExceptionHandler(ex, "AddNode()--loading swf file", "XML\\XmlParser.cs");
                            }
                        }

                        AddNode(xNode, ref parUsrService);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddNode()", "XML\\XmlParser.cs");
            }
        }
Beispiel #2
0
        private static void AddNode(XmlNode inXmlNode, ref XmlMain parUsrService)
        {
            try
            {
                XmlNode xNode;
                XmlNodeList nodeList;
                int i;
                if (inXmlNode.Attributes[0].Name == "Name")
                {
                    parUsrService.ModuleName = inXmlNode.Attributes[0].Value;
                }
                if (inXmlNode.HasChildNodes)
                {
                    nodeList = inXmlNode.ChildNodes;
                    for (i = 0; i <= nodeList.Count - 1; i++)
                    {
                        xNode = inXmlNode.ChildNodes[i];
                        if (xNode.Attributes.Count > 1)
                        {
                            for (int j = 0; j < xNode.Attributes.Count; j++)
                            {
                                if (xNode.Attributes[j].Name.ToLower() == "class")
                                {
                                    parUsrService.DummyClassName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "method")
                                {
                                    parUsrService.DummyMethodName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "supernodeclass")
                                {
                                    parUsrService.SuperNodeClass = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "assembly")
                                {
                                    parUsrService.Assembly = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "classname")
                                {
                                    parUsrService.P2PDummyClassName = xNode.Attributes[j].Value;
                                }
                                if (xNode.Attributes[j].Name.ToLower() == "methodname")
                                {
                                    parUsrService.P2PDummyMethodName = xNode.Attributes[j].Value;
                                }                                
                            }
                        }
                        else
                        {
                            try
                            {
                                if (xNode.Attributes[0].Name.ToLower() == "swffilename")
                                {
                                    parUsrService.SWFFileName = xNode.Attributes[0].Value;
                                }
                                if (xNode.Attributes[0].Name.ToLower() == "textfilename")
                                {
                                    parUsrService.TextFileName = xNode.Attributes[0].Value;
                                }
                            }
                            catch (Exception ex)
                            {
                                VMuktiHelper.ExceptionHandler(ex, "AddNode()--loading swf file", "XML\\XmlParser.cs");
                            }
                        }

                        AddNode(xNode, ref parUsrService);
                    }

                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddNode()", "XML\\XmlParser.cs");
            }
        }