Example #1
0
 public void Add(AvailablePlugin pluginToAdd)
 {
     List.Add(pluginToAdd);
 }
Example #2
0
 public void Remove(AvailablePlugin pluginToRemove)
 {
     List.Remove(pluginToRemove);
 }
Example #3
0
 ///// <summary>
 ///// Select menu's level
 ///// </summary>
 ///// <param name="c">Menu's name</param>
 ///// <returns></returns>
 //public List<AvailablePlugin> Select(string c)
 //{
 //    var a = XDocument.Load(_c);
 //    var b = from s in a.Descendants(c)
 //            select new
 //            {
 //                Vn = s.Attribute("vn"),
 //                En = s.Attribute("en"),
 //                Ns = s.Attribute("ns")
 //            };
 //    var l = new List<AvailablePlugin>();
 //    foreach (var i in b)
 //    {
 //        var p = new AvailablePlugin()
 //        {
 //            Text1 = i.Vn.Value,
 //            Text2 = i.En.Value,
 //            Type = i.Ns.Value
 //        };
 //        l.Add(p);
 //    }
 //    return l;
 //}
 /// <summary>
 /// Select menu's level
 /// </summary>
 /// <param name="c">Menu's name</param>
 /// <returns></returns>
 public List<AvailablePlugin> Select(string c)
 {
     var a = XDocument.Load(_c);
     var b = from s in a.Descendants(c)
             select new
             {
                 Level = s.Element("Level").Value,
                 Text1 = s.Element("Text1").Value,
                 Text2 = s.Element("Text2").Value,
                 Type = s.Element("Type").Value,
                 Show = s.Element("Show").Value,
             };
     var l = new List<AvailablePlugin>();
     foreach (var s in b)
     {
         var p = new AvailablePlugin()
         {
             Level = Convert.ToInt32(s.Level),
             Text1 = s.Text1,
             Text2 = s.Text2,
             Type = s.Type,
             Show = Convert.ToBoolean(s.Show)
         };
         l.Add(p);
     }
     return l;
 }