Exemple #1
0
        public static SMSSender CreateInstance(string name, string configXml)
        {
            SMSSender result;

            if (string.IsNullOrEmpty(name))
            {
                result = null;
            }
            else
            {
                Type plugin = SMSPlugins.Instance().GetPlugin("SMSSender", name);
                if (plugin == null)
                {
                    result = null;
                }
                else
                {
                    SMSSender sMSSender = Activator.CreateInstance(plugin) as SMSSender;
                    if (sMSSender != null && !string.IsNullOrEmpty(configXml))
                    {
                        XmlDocument xmlDocument = new XmlDocument();
                        xmlDocument.LoadXml(configXml);
                        sMSSender.InitConfig(xmlDocument.FirstChild);
                    }
                    result = sMSSender;
                }
            }
            return(result);
        }
Exemple #2
0
        public static SMSSender CreateInstance(string name, string configXml)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            Type plugin = SMSPlugins.Instance().GetPlugin("SMSSender", name);

            if (plugin == null)
            {
                return(null);
            }
            SMSSender sender = Activator.CreateInstance(plugin) as SMSSender;

            if ((sender != null) && !string.IsNullOrEmpty(configXml))
            {
                XmlDocument document = new XmlDocument();
                document.LoadXml(configXml);
                sender.InitConfig(document.FirstChild);
            }
            return(sender);
        }
Exemple #3
0
        public static SMSSender CreateInstance(string name, string configXml)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            Type plugin = SMSPlugins.Instance().GetPlugin("SMSSender", name);

            if (plugin == null)
            {
                return(null);
            }
            SMSSender sMSSender = Activator.CreateInstance(plugin) as SMSSender;

            if (sMSSender != null && !string.IsNullOrEmpty(configXml))
            {
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.XmlResolver = null;
                xmlDocument.LoadXml(configXml);
                sMSSender.InitConfig(xmlDocument.FirstChild);
            }
            Globals.AppendLog(new Dictionary <string, string>(), "SMSSender CreateInstance" + "--" + name + ":" + configXml, "", "", "/log/SMSSender.txt");
            return(sMSSender);
        }