Beispiel #1
0
 private FeatureActivator(ActivationDirection direction, InstallOperation operation, ILog log)
 {
     this.direction = direction;
     this.operation = operation;
     this.log       = log;
     requestedLocs  = InstallProcessControl.GetFeaturedLocations(operation);
 }
Beispiel #2
0
 private FeaturesCommand(InstallProcessControl parent, FeatureActivator.ActivationDirection direction, InstallOperation operation)
     : base(parent)
 {
     this.direction = direction;
     this.operation = operation;
     requestedLocs  = InstallProcessControl.GetFeaturedLocations(operation);
 }
Beispiel #3
0
        public static string Describe(FeatureLocations locs, FeatureActivator.ActivationDirection direction)
        {
            string fmt = (direction == FeatureActivator.ActivationDirection.Activate ? CommonUIStrings.activatingFeaturesMessage
                : CommonUIStrings.deactivatingFeaturesMessage);

            return(String.Format(fmt
                                 , locs.ActivationsCount
                                 , InstallConfiguration.FeatureIdList.Count
                                 , locs.LocationsCount
                                 ));
        }
Beispiel #4
0
        private void UpdateDisplay()
        {
            FeatureLocations fLocs           = InstallProcessControl.GetFeaturedLocations(Form.Operation);
            string           locationSummary = (new LocationDisplay(fLocs)).GetLocationSummary();

            featureLocationSummaryLabel.Text = locationSummary;
            if (fLocs.GetTotalFeatureLocations() == 0)
            {
                dodeactivateFeaturesChoice.Enabled = false;
                doactivateFeaturesChoice.Enabled   = false;
            }
            else
            {
                dodeactivateFeaturesChoice.Enabled = true;
                doactivateFeaturesChoice.Enabled   = upgradeRadioButton.Checked && dodeactivateFeaturesChoice.Checked;
            }
        }
 public static string Describe(FeatureLocations locs, FeatureActivator.ActivationDirection direction)
 {
     string fmt = (direction == FeatureActivator.ActivationDirection.Activate ? CommonUIStrings.activatingFeaturesMessage
         : CommonUIStrings.deactivatingFeaturesMessage);
     return String.Format(fmt
         , locs.ActivationsCount
         , InstallConfiguration.FeatureIdList.Count
         , locs.LocationsCount
     );
 }
 private FeatureActivator(ActivationDirection direction, InstallOperation operation, ILog log)
 {
     this.direction = direction;
     this.operation = operation;
     this.log = log;
     requestedLocs = InstallProcessControl.GetFeaturedLocations(operation);
 }
 private FeaturesCommand(InstallProcessControl parent, FeatureActivator.ActivationDirection direction, InstallOperation operation)
     : base(parent)
 {
     this.direction = direction;
     this.operation = operation;
     requestedLocs = InstallProcessControl.GetFeaturedLocations(operation);
 }
Beispiel #8
0
 public LocationDisplay(FeatureLocations fLocs)
 {
     this.featuredLocations = fLocs;
 }
 public LocationDisplay(FeatureLocations fLocs)
 {
     this.featuredLocations = fLocs;
 }
Beispiel #10
0
        private void ReportActivations()
        {
            FeatureLocations flocs = InstallProcessControl.GetFeaturedLocations(myOperation);

            myList.View = View.Details;
            myList.Columns.Clear();
            myList.Columns.Add("Scope", 50);
            myList.Columns.Add("WebApp", 100);
            myList.Columns.Add("Site", 100);
            myList.Columns.Add("Web", 100);
            if (InstallConfiguration.FeatureIdList.Count > 1)
            {
                myList.Columns.Add("#Features", 30);
            }
            // Farm
            foreach (FeatureLoc floc in flocs.FarmLocations)
            {
                AddLocationItemToDisplay(SPFeatureScope.Farm, "", "", "", floc.featureList.Count);
            }
            // Web Application
            foreach (FeatureLoc floc in flocs.WebAppLocations)
            {
                SPWebApplication webapp = GetWebAppById(floc.WebAppId);
                if (webapp == null)
                {
                    continue;
                }
                AddLocationItemToDisplay(SPFeatureScope.WebApplication
                                         , GetWebAppName(webapp), "", "", floc.featureList.Count);
            }
            // Site Collection
            foreach (FeatureLoc floc in flocs.SiteLocations)
            {
                SPSite site = new SPSite(floc.SiteId);
                if (site == null)
                {
                    continue;
                }
                try
                {
                    AddLocationItemToDisplay(SPFeatureScope.Site
                                             , GetWebAppName(site.WebApplication), site.RootWeb.Title
                                             , "", floc.featureList.Count);
                }
                finally
                {
                    site.Dispose();
                }
            }
            // Web
            foreach (FeatureLoc floc in flocs.WebLocations)
            {
                SPSite site = new SPSite(floc.SiteId);
                if (site == null)
                {
                    continue;
                }
                try
                {
                    SPWeb web = site.OpenWeb(floc.WebId);
                    if (web == null)
                    {
                        continue;
                    }
                    try
                    {
                        AddLocationItemToDisplay(SPFeatureScope.Web
                                                 , GetWebAppName(web.Site.WebApplication), web.Site.RootWeb.Title
                                                 , web.Title, floc.featureList.Count);
                    }
                    finally
                    {
                        web.Dispose();
                    }
                }
                finally
                {
                    site.Dispose();
                }
            }
        }