Esempio n. 1
0
 public void Add(PluginItem item)
 {
     if (!this.plugins.ContainsKey(item.FullName))
     {
         this.plugins.Add(item.FullName, item);
     }
 }
Esempio n. 2
0
 public void Add(PluginItem item)
 {
     if (!this.plugins.ContainsKey(item.FullName))
     {
         this.plugins.Add(item.FullName, item);
     }
 }
Esempio n. 3
0
        protected PluginItem GetPluginItem(string baseName, string fullName)
        {
            PluginItem  result      = null;
            XmlDocument xmlDocument = PluginContainer.pluginCache.Get(this.IndexCacheKey) as XmlDocument;
            XmlNode     xmlNode     = xmlDocument.SelectSingleNode(string.Concat(new string[]
            {
                "//",
                baseName,
                "/item[@identity='",
                fullName,
                "']"
            }));

            if (xmlNode != null)
            {
                result = new PluginItem
                {
                    FullName         = xmlNode.Attributes["identity"].Value,
                    DisplayName      = xmlNode.Attributes["name"].Value,
                    Logo             = xmlNode.Attributes["logo"].Value,
                    ShortDescription = xmlNode.Attributes["shortDescription"].Value,
                    Description      = xmlNode.Attributes["description"].Value
                };
            }
            return(result);
        }
Esempio n. 4
0
        public virtual string ToJsonString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("{");
            stringBuilder.AppendFormat("\"qty\":{0}", this.plugins.Count.ToString(CultureInfo.InvariantCulture));
            if (this.plugins.Count > 0)
            {
                stringBuilder.Append(",\"items\":[");
                foreach (string current in this.plugins.Keys)
                {
                    PluginItem pluginItem = this.plugins[current];
                    stringBuilder.Append("{");
                    stringBuilder.AppendFormat("\"FullName\":\"{0}\",\"DisplayName\":\"{1}\",\"Logo\":\"{2}\",\"ShortDescription\":\"{3}\",\"Description\":\"{4}\"", new object[]
                    {
                        pluginItem.FullName,
                        pluginItem.DisplayName,
                        pluginItem.Logo,
                        pluginItem.ShortDescription,
                        pluginItem.Description
                    });
                    stringBuilder.Append("},");
                }
                stringBuilder.Remove(stringBuilder.Length - 1, 1);
                stringBuilder.Append("]");
            }
            stringBuilder.Append("}");
            return(stringBuilder.ToString());
        }
Esempio n. 5
0
        public virtual string ToXmlString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<xml>");
            builder.AppendFormat("<qty>{0}</qty>", this.plugins.Count.ToString(CultureInfo.InvariantCulture));
            foreach (string str in this.plugins.Keys)
            {
                PluginItem item = this.plugins[str];
                builder.Append("<item>");
                builder.AppendFormat("<FullName>{0}</FullName><DisplayName>{1}</DisplayName><Logo>{2}</Logo><ShortDescription>{3}</ShortDescription><Description>{4}</Description>", new object[] { item.FullName, item.DisplayName, item.Logo, item.ShortDescription, item.Description });
                builder.Append("</item>");
            }
            builder.Append("</xml>");
            return(builder.ToString());
        }
Esempio n. 6
0
 protected PluginItem GetPluginItem(string baseName, string fullName)
 {
     PluginItem item = null;
     XmlNode node = (pluginCache.Get(this.IndexCacheKey) as XmlDocument).SelectSingleNode("//" + baseName + "/item[@identity='" + fullName + "']");
     if (node != null)
     {
         item = new PluginItem {
             FullName = node.Attributes["identity"].Value,
             DisplayName = node.Attributes["name"].Value,
             Logo = node.Attributes["logo"].Value,
             ShortDescription = node.Attributes["shortDescription"].Value,
             Description = node.Attributes["description"].Value
         };
     }
     return item;
 }
        protected PluginItem GetPluginItem(string baseName, string fullName)
        {
            PluginItem item = null;
            XmlNode    node = (pluginCache.Get(this.IndexCacheKey) as XmlDocument).SelectSingleNode("//" + baseName + "/item[@identity='" + fullName + "']");

            if (node != null)
            {
                item = new PluginItem {
                    FullName         = node.Attributes["identity"].Value,
                    DisplayName      = node.Attributes["name"].Value,
                    Logo             = node.Attributes["logo"].Value,
                    ShortDescription = node.Attributes["shortDescription"].Value,
                    Description      = node.Attributes["description"].Value
                };
            }
            return(item);
        }
Esempio n. 8
0
        protected PluginItem GetPluginItem(string baseName, string fullName)
        {
            PluginItem  result      = null;
            XmlDocument xmlDocument = PluginContainer.pluginCache.Get(this.IndexCacheKey) as XmlDocument;
            XmlNode     xmlNode     = xmlDocument.SelectSingleNode("//" + baseName + "/item[@identity='" + fullName + "']");

            if (xmlNode != null)
            {
                PluginItem pluginItem = new PluginItem();
                pluginItem.FullName         = xmlNode.Attributes["identity"].Value;
                pluginItem.DisplayName      = xmlNode.Attributes["name"].Value;
                pluginItem.Logo             = xmlNode.Attributes["logo"].Value;
                pluginItem.ShortDescription = xmlNode.Attributes["shortDescription"].Value;
                pluginItem.Description      = xmlNode.Attributes["description"].Value;
                result = pluginItem;
            }
            return(result);
        }
        protected PluginItemCollection GetPlugins(string baseName)
        {
            PluginItemCollection items = new PluginItemCollection();
            XmlNodeList          list  = (pluginCache.Get(this.IndexCacheKey) as XmlDocument).SelectNodes("//" + baseName + "/item");

            if ((list != null) && (list.Count > 0))
            {
                foreach (XmlNode node in list)
                {
                    PluginItem item = new PluginItem {
                        FullName         = node.Attributes["identity"].Value,
                        DisplayName      = node.Attributes["name"].Value,
                        Logo             = node.Attributes["logo"].Value,
                        ShortDescription = node.Attributes["shortDescription"].Value,
                        Description      = node.Attributes["description"].Value
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Esempio n. 10
0
        protected PluginItemCollection GetPlugins(string baseName)
        {
            PluginItemCollection pluginItemCollection = new PluginItemCollection();
            XmlDocument          xmlDocument          = PluginContainer.pluginCache.Get(this.IndexCacheKey) as XmlDocument;
            XmlNodeList          xmlNodeList          = xmlDocument.SelectNodes("//" + baseName + "/item");

            if (xmlNodeList != null && xmlNodeList.Count > 0)
            {
                foreach (XmlNode xmlNode in xmlNodeList)
                {
                    PluginItem item = new PluginItem
                    {
                        FullName         = xmlNode.Attributes["identity"].Value,
                        DisplayName      = xmlNode.Attributes["name"].Value,
                        Logo             = xmlNode.Attributes["logo"].Value,
                        ShortDescription = xmlNode.Attributes["shortDescription"].Value,
                        Description      = xmlNode.Attributes["description"].Value
                    };
                    pluginItemCollection.Add(item);
                }
            }
            return(pluginItemCollection);
        }
Esempio n. 11
0
        protected PluginItemCollection GetPlugins(string baseName)
        {
            PluginItemCollection pluginItemCollection = new PluginItemCollection();
            XmlDocument          xmlDocument          = PluginContainer.pluginCache.Get(this.IndexCacheKey) as XmlDocument;
            XmlNodeList          xmlNodeList          = xmlDocument.SelectNodes("//" + baseName + "/item");

            Globals.AppendLog(new Dictionary <string, string>(), this.IndexCacheKey + ":" + xmlDocument.ToString(), "", "", "/log/SMSSender.txt");
            if (xmlNodeList != null && xmlNodeList.Count > 0)
            {
                foreach (XmlNode item2 in xmlNodeList)
                {
                    PluginItem pluginItem = new PluginItem();
                    pluginItem.FullName         = item2.Attributes["identity"].Value;
                    pluginItem.DisplayName      = item2.Attributes["name"].Value;
                    pluginItem.Logo             = item2.Attributes["logo"].Value;
                    pluginItem.ShortDescription = item2.Attributes["shortDescription"].Value;
                    pluginItem.Description      = item2.Attributes["description"].Value;
                    PluginItem item = pluginItem;
                    pluginItemCollection.Add(item);
                }
            }
            Globals.AppendLog(new Dictionary <string, string>(), baseName + ":" + pluginItemCollection.ToJsonString(), "", "", "/log/SMSSender.txt");
            return(pluginItemCollection);
        }
Esempio n. 12
0
 protected PluginItemCollection GetPlugins(string baseName)
 {
     PluginItemCollection items = new PluginItemCollection();
     XmlNodeList list = (pluginCache.Get(this.IndexCacheKey) as XmlDocument).SelectNodes("//" + baseName + "/item");
     if ((list != null) && (list.Count > 0))
     {
         foreach (XmlNode node in list)
         {
             PluginItem item2 = new PluginItem
             {
                 FullName = node.Attributes["identity"].Value,
                 DisplayName = node.Attributes["name"].Value,
                 Logo = node.Attributes["logo"].Value,
                 ShortDescription = node.Attributes["shortDescription"].Value,
                 Description = node.Attributes["description"].Value
             };
             PluginItem item = item2;
             items.Add(item);
         }
     }
     return items;
 }