Ejemplo n.º 1
0
        /// <summary>
        /// 根据版本信息和唯一标示名获取插件列表
        /// </summary>
        /// <param name="symbolicName"></param>
        /// <param name="versionRange"></param>
        /// <returns></returns>
        public IBundle[] GetBundles(string symbolicName, string versionRange)
        {
            IBundle[]       bundles    = framework.Bundles.GetBundles(symbolicName);
            IList <IBundle> newBundles = new List <IBundle>();
            VersionRange    range      = new VersionRange(versionRange);

            foreach (var bundle in bundles)
            {
                if (range.IsIncluded(bundle.Version))
                {
                    newBundles.Add(bundle);
                }
            }

            return(newBundles.Count > 0 ? newBundles.ToArray() : null);
        }