Beispiel #1
0
 private static void ProcessXinGeSender(HttpContext context)
 {
     if (context.Request["action"] == "getlist")
     {
         XingePushPlugins xinGePlugins = XingePushPlugins.Instance();
         context.Response.ContentType = "application/json";
         context.Response.Write(xinGePlugins.GetPlugins().ToJsonString());
     }
     else
     {
         if (context.Request["action"] == "getmetadata")
         {
             context.Response.ContentType = "text/xml";
             XingePush xinGePlugins = XingePush.CreateInstance(context.Request["name"]);
             if (xinGePlugins == null)
             {
                 context.Response.Write("<xml></xml>");
             }
             else
             {
                 context.Response.Write(xinGePlugins.GetMetaData().OuterXml);
             }
         }
     }
 }
Beispiel #2
0
        public static XingePush CreateInstance(string name, string configXml)
        {
            XingePush result;

            if (string.IsNullOrEmpty(name))
            {
                result = null;
            }
            else
            {
                Type plugin = XingePushPlugins.Instance().GetPlugin("XingePush", name);
                if (plugin == null)
                {
                    result = null;
                }
                else
                {
                    XingePush xingePush = Activator.CreateInstance(plugin) as XingePush;
                    if (xingePush != null && !string.IsNullOrEmpty(configXml))
                    {
                        XmlDocument xmlDocument = new XmlDocument();
                        xmlDocument.LoadXml(configXml);
                        xingePush.InitConfig(xmlDocument.FirstChild);
                    }
                    result = xingePush;
                }
            }
            return(result);
        }
Beispiel #3
0
 public static XingePush CreateInstance(string name)
 {
     return(XingePush.CreateInstance(name, null));
 }