// A project was removed or unloaded. void projectService_ProjectDisposing(object sender, SharePointProjectEventArgs e) { ISharePointProject project = (ISharePointProject)sender; string message = String.Format("The following project was removed or unloaded: {0}", e.Project.Name); project.ProjectService.Logger.WriteLine(message, LogCategory.Message); }
// A project is loaded in the IDE. void projectService_ProjectInitialized(object sender, SharePointProjectEventArgs e) { ISharePointProject project = (ISharePointProject)sender; string message = String.Format("The following project is being initialized: {0}", e.Project.Name); project.ProjectService.Logger.WriteLine(message, LogCategory.Message); }
// Creates the new deployment configuration. private void ProjectInitialized(object sender, SharePointProjectEventArgs e) { string[] deploymentSteps = new string[] { DeploymentStepIds.PreDeploymentCommand, DeploymentStepIds.RecycleApplicationPool, "Contoso.DeploymentSteps.UpgradeSolution", DeploymentStepIds.PostDeploymentCommand }; string[] retractionSteps = new string[] { DeploymentStepIds.RecycleApplicationPool, DeploymentStepIds.RetractSolution }; IDeploymentConfiguration configuration = e.Project.DeploymentConfigurations.Add( "Upgrade", deploymentSteps, retractionSteps); configuration.Description = "This is the upgrade deployment configuration"; }
/// <summary> /// Projects the initialized. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.SharePointProjectEventArgs"/> instance containing the event data.</param> private void ProjectInitialized(object sender, SharePointProjectEventArgs e) { //Add the new configuration. if (!e.Project.DeploymentConfigurations.ContainsKey(CKSProperties.UpgradeDeploymentConfigurationExtension_Name)) { string[] deploymentSteps = new string[] { DeploymentStepIds.PreDeploymentCommand, CustomDeploymentStepIds.CopyToSharePointRoot, DeploymentStepIds.PostDeploymentCommand }; string[] retractionSteps = new string[] { DeploymentStepIds.RecycleApplicationPool, DeploymentStepIds.RetractSolution }; IDeploymentConfiguration configuration = e.Project.DeploymentConfigurations.Add( CKSProperties.QuickDeployFilesDeploymentConfigurationExtension_Name, deploymentSteps, retractionSteps); configuration.Description = CKSProperties.QuickDeployFilesDeploymentConfigurationExtension_Description; } }