Exemplo n.º 1
0
        public bool Load(ref string csError)
        {
            bool bRes = true;
            XmlDocument xmlDoc = new XmlDocument();
            if (File.Exists(StaticXml.m_XMLFile))
            {
                if (ReadXmlFile(xmlDoc))
                {
                    XmlNode root = xmlDoc.DocumentElement;
                    {
                        if (root.Name.Equals(const_Root))
                        {

                            XmlAttributeCollection attrcollection = root.Attributes;
                            StaticXml.Get_wRect(ref wrect, attrcollection);

                            if (root.ChildNodes.Count > 0)
                            {
                                foreach (XmlNode node in root.ChildNodes)
                                {
                                    if (node.Name.Equals(const_TableDockingForm))
                                    {
                                        TableDockingFormXml xTableDockingFormXml = new TableDockingFormXml();
                                        xTableDockingFormXml.Parse(node, ref bRes);
                                        m_xmldata.Add(xTableDockingFormXml);
                                    }
                                    else
                                    {
                                        csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlIlegalNode.s + " \"" + node.Name + "\"." + lngRPM.s_Expected.s + "=\"" + const_TableDockingForm + "\"";
                                        bRes = false;
                                    }
                                }
                            }
                            else
                            {
                                csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlNodeNotFound.s + " \"" + const_TableDockingForm + "\"";
                                bRes = false;
                            }
                        }
                        else
                        {
                            csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlRootNotFound.s + lngRPM.s_Expected.s + "\"" + const_Root + "\"";
                            bRes = false;
                        }
                    }
                }
                else
                {
                    csError = lngRPM.s_Error.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_XmlFileNotLoadedInXmlDocument.s;
                    bRes = false;
                }
            }
            else
            {
                csError = lngRPM.s_Warning.s + ":" + lngRPM.s_File.s + "=" + StaticXml.m_XMLFile + ":" + lngRPM.s_DoesNotExist.s;
                bRes = false;
            }
            return bRes;
        }