Ejemplo n.º 1
0
        public override void MapDataFields(System.Data.DataRow currentRow)
        {
            base.MapDataFields(currentRow);

            System.Xml.XmlDocument configurationXml = new System.Xml.XmlDocument();


            assemblyPath = (String)currentRow["AssemblyPath"];

            assemblyName = (String)currentRow["AssemblyName"];

            assemblyClassName = (String)currentRow["AssemblyClassName"];


            FaxServerConfiguration = new Public.Faxing.FaxServerConfiguration();

            try {
                if (!(currentRow["FaxServerConfiguration"] is DBNull))
                {
                    if (!String.IsNullOrEmpty((String)currentRow["FaxServerConfiguration"]))
                    {
                        configurationXml.LoadXml((String)currentRow["FaxServerConfiguration"]);

                        FaxServerConfiguration.XmlImport(configurationXml.ChildNodes[0]);
                    }
                }
            }

            catch { /* DO NOTHING */ }


            WebServiceHostConfiguration = new Public.WebService.WebServiceHostConfiguration();

            try {
                if (!(currentRow["WebServiceHostConfiguration"] is DBNull))
                {
                    if (!String.IsNullOrEmpty((String)currentRow["WebServiceHostConfiguration"]))
                    {
                        configurationXml.LoadXml((String)currentRow["WebServiceHostConfiguration"]);

                        WebServiceHostConfiguration.XmlImport(configurationXml.ChildNodes[0]);
                    }
                }
            }

            catch { /* DO NOTHING */ }

            return;
        }
Ejemplo n.º 2
0
        public override List <ImportExport.Result> XmlImport(System.Xml.XmlNode objectNode)
        {
            List <ImportExport.Result> response = base.XmlImport(objectNode);

            System.Xml.XmlDocument configurationXml = new System.Xml.XmlDocument();


            try {
                foreach (System.Xml.XmlNode currentNode in objectNode.ChildNodes)
                {
                    switch (currentNode.Name)
                    {
                    case "Properties":

                        foreach (System.Xml.XmlNode currentPropertyNode in currentNode.ChildNodes)
                        {
                            switch (currentPropertyNode.Attributes["Name"].InnerText)
                            {
                            case "AssemblyPath": AssemblyPath = currentPropertyNode.InnerText; break;

                            case "AssemblyName": AssemblyName = currentPropertyNode.InnerText; break;

                            case "AssemblyClassName": AssemblyClassName = currentPropertyNode.InnerText; break;

                            case "FaxServerConfiguration":

                                configurationXml = new System.Xml.XmlDocument();


                                FaxServerConfiguration = new Public.Faxing.FaxServerConfiguration();

                                try {
                                    if (!String.IsNullOrEmpty(currentPropertyNode.InnerText))
                                    {
                                        configurationXml.LoadXml(currentPropertyNode.InnerText);

                                        FaxServerConfiguration.XmlImport(configurationXml.ChildNodes[0]);
                                    }
                                }

                                catch { /* DO NOTHING */ }

                                break;

                            case "WebServiceHostConfiguration":

                                configurationXml = new System.Xml.XmlDocument();


                                WebServiceHostConfiguration = new Public.WebService.WebServiceHostConfiguration();

                                try {
                                    if (!String.IsNullOrEmpty(currentPropertyNode.InnerText))
                                    {
                                        configurationXml.LoadXml(currentPropertyNode.InnerText);

                                        WebServiceHostConfiguration.XmlImport(configurationXml.ChildNodes[0]);
                                    }
                                }

                                catch { /* DO NOTHING */ }

                                break;

                            default: break;
                            }
                        }

                        break;
                    } // switch (currentNode.Attributes["Name"].InnerText) {
                }     // foreach (System.Xml.XmlNode currentNode in objectNode.ChildNodes) {


                // SAVE IMPORTED CLASS

                if (!Save())
                {
                    throw new ApplicationException("Unable to save " + base.ObjectType + ": " + Name + ".");
                }
            }

            catch (Exception importException) {
                response.Add(new ImportExport.Result(ObjectType, Name, importException));
            }

            return(response);
        }