/// <summary>
        /// 获取开启的特性。
        /// </summary>
        /// <param name="extensionManager">扩展管理者。</param>
        /// <param name="descriptor">外壳描述符。</param>
        /// <returns></returns>
        public static IEnumerable<FeatureDescriptor> EnabledFeatures(this IExtensionManager extensionManager, ShellDescriptor descriptor)
        {
            extensionManager.NotNull("extensionManager");

            var features = extensionManager.AvailableFeatures();
            if (descriptor != null)
                features = features.Where(fd => descriptor.Features.Any(sf => sf.Name == fd.Id));

            return features.ToArray();
        }
 public static IEnumerable<FeatureDescriptor> DisabledFeatures(this IExtensionManager extensionManager, ShellDescriptor descriptor)
 {
     return extensionManager.AvailableFeatures().Where(fd => descriptor.Features.All(sf => sf.Name != fd.Id));
 }
 public static IEnumerable<FeatureDescriptor> EnabledFeatures(this IExtensionManager extensionManager, IEnumerable<ShellFeature> features)
 {
     return extensionManager.AvailableFeatures().Where(fd => features.Any(sf => sf.Name == fd.Id));
 }