Example #1
0
 /// <summary>
 /// Store Next Title to be used for most recently added control
 /// </summary>
 /// <param name="title"></param>
 public void StoreNextTitle(string title)
 {
     if (ContentControls.Count > 0)
     {
         InstallerControl control = ContentControls[ContentControls.Count - 1];
         control.StoreNextTitle(title);
         if (currentContentControl == control)
         {
             DisplayNextTitle(title);
         }
     }
 }
Example #2
0
        private void AddInstallControls()
        {
            //
            // Add EULA control if an EULA file was specified.
            //
            string filename = InstallConfiguration.EULA;

            if (!String.IsNullOrEmpty(filename))
            {
                Form.StoreNextTitle(Resources.CommonUIStrings.controlTitleLicense);
                Form.ContentControls.Add(Program.CreateEULAControl());
            }


            // Allow user to choose target web applications if either
            // (1) scope = Web Application
            // (2) option PromptForWebApplications was set
            //       This is for web parts, which may be site or web scope
            //       but which typically need SafeControl entries at the web app level
            //       and we don't have access to the installed solution yet, to query
            //       whether it contains web app resources, so we depend on the option
            bool webappDeploy = (InstallConfiguration.FeatureScope == Microsoft.SharePoint.SPFeatureScope.WebApplication) ||
                                InstallConfiguration.PromptForWebApplications;

            if (webappDeploy)
            {
                Form.StoreNextTitle(Resources.CommonUIStrings.controlTitleWebApplicationDeployment);
                Form.ContentControls.Add(Program.CreateWebAppDeploymentTargetsControl());
            }
            // Have user choose site collections if scope is site collection
            if (InstallConfiguration.FeatureScope == Microsoft.SharePoint.SPFeatureScope.Site)
            {
                ReadOnlyCollection <Guid?> featureIds = InstallConfiguration.FeatureIdList;
                if (featureIds == null || featureIds.Count == 0)
                {
                    LogManager.GetLogger().Warn(Resources.CommonUIStrings.skippingSiteSelectionNoFeature);
                }
                else
                {
                    Form.StoreNextTitle(Resources.CommonUIStrings.controlTitleSiteDeployment);
                    // For now try to assign all listed features for all specified site collections
                    // This is not ideal, but at install time we don't know what scope each of these features is
                    // This is why we need optional scope modifiers in feature list
                    InstallerControl ctl = Program.CreateSiteCollectionDeploymentTargetsControl(featureIds);
                    Form.ContentControls.Add(ctl);
                }
            }

            //Form.ContentControls.Add(Program.CreateOptionsControl());
            Form.StoreNextTitle(Resources.CommonUIStrings.controlTitleInstalling);
            Form.ContentControls.Add(Program.CreateProcessControl());
        }
Example #3
0
        private void ReplaceContentControl(int index)
        {
            if (currentContentControl != null)
            {
                currentContentControl.CloseControl(options);
            }

            if (index == 0)
            {
                prevButton.Enabled = false;
                nextButton.Enabled = true;
            }
            else if (index == (contentControls.Count - 1))
            {
                prevButton.Enabled = true;
                nextButton.Enabled = false;
            }
            else
            {
                prevButton.Enabled = true;
                nextButton.Enabled = true;
            }

            InstallerControl newContentControl = contentControls[index];

            newContentControl.Dock = DockStyle.Fill;

            titleLabel.Text    = newContentControl.Title;
            subTitleLabel.Text = newContentControl.SubTitle;

            contentPanel.Controls.Clear();
            contentPanel.Controls.Add(newContentControl);

            newContentControl.OpenControl(options);

            currentContentControl = newContentControl;
        }