void projectItemTypeDefinition_ProjectItemAdded(object sender, SharePointProjectItemEventArgs e) { string message = String.Format("An example project item named {0} was added to the {1} project.", e.ProjectItem.Name, e.ProjectItem.Project.Name); e.ProjectItem.Project.ProjectService.Logger.WriteLine(message, LogCategory.Message); }
void projectItemType_ProjectItemAdded(object sender, SharePointProjectItemEventArgs e) { ISharePointProjectItem projectItem = (ISharePointProjectItem)sender; string message = String.Format("An Event Handler project item named {0} was added to the {1} project.", projectItem.Name, projectItem.Project.Name); projectItem.Project.ProjectService.Logger.WriteLine(message, LogCategory.Message); }
/// <summary> /// Handles the ProjectItemInitialized event of the spiType control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SharePointProjectItemEventArgs" /> instance containing the event data.</param> private void spiType_ProjectItemInitialized(object sender, SharePointProjectItemEventArgs e) { if (recentlyAddedItem == e.ProjectItem.Id) { recentlyAddedItem = Guid.Empty; ISharePointProjectItem spi = e.ProjectItem; IEnumerable <ISharePointProjectFeature> source = from ISharePointProjectFeature feature in spi.Project.Features where feature.ProjectItems.Contains(spi) select feature; if ((source != null) && (source.Count() > 0)) { foreach (ISharePointProjectFeature feature in source) { feature.ProjectItems.Remove(spi); } } } }
private void ProjectItemDisposing(object sender, SharePointProjectItemEventArgs e) { e.ProjectItem.Project.PropertyChanged -= ProjectPropertyChanged; }
private void ProjectItemInitialized(object sender, SharePointProjectItemEventArgs e) { // 处理项目事件。 e.ProjectItem.Project.PropertyChanged += ProjectPropertyChanged; }
/// <summary> /// Handles the ProjectItemInitialized event of the typeDefinition control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.SharePointProjectItemEventArgs"/> instance containing the event data.</param> void typeDefinition_ProjectItemInitialized(object sender, SharePointProjectItemEventArgs e) { }
/// <summary> /// Handles the ProjectItemAdded event of the TypeDefinition control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.SharePointProjectItemEventArgs"/> instance containing the event data.</param> void TypeDefinition_ProjectItemAdded(object sender, SharePointProjectItemEventArgs e) { }
/// <summary> /// Handles the ProjectItemAdded event of the spiType control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SharePointProjectItemEventArgs" /> instance containing the event data.</param> private void spiType_ProjectItemAdded(object sender, SharePointProjectItemEventArgs e) { recentlyAddedItem = e.ProjectItem.Id; }
private void ProjectItemInitialized(object sender, SharePointProjectItemEventArgs e) { // Handle a project event. e.ProjectItem.Project.PropertyChanged += ProjectPropertyChanged; }