public FeaturesService(IServiceProvider services)
        {
            ServiceProvider = services;

            var allFeatureTypes = GetAllFeatures();

            foreach (var featureType in allFeatureTypes)
            {
                IFeatureDefinition feature = null;
                if (ServiceProvider != null)
                {
                    feature = ServiceProvider.GetService(featureType) as IFeatureDefinition;
                }
                if (feature == null)
                {
                    feature = Activator.CreateInstance(featureType) as IFeatureDefinition;
                }
                Features.Add(feature);
            }
        }
예제 #2
0
 public FeatureViewModel(IFeatureDefinition fd)
 {
     Feature = fd;
 }