开发方法:
添加库引用
Using Microsoft.Office.Project.Server.Events;
Using Microsoft.Office.Project.Server.Library;
继承相应Receiver类,重载相应事件的方法
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Project.Server.Events;
using Microsoft.Office.Project.Server.Library;
namespace myEventHandler
{
public class myProjectEvent: ProjectEventReceiver
{
public override void OnPublished(PSContextInfocontextInfo, ProjectPostPublishEventArgs e)
{
// 事件处理逻辑
}
}
}
部署方法:
设置dll强名称
注册到GAC
注册到Project Server
Project Server事件接口
Project |
ProjectEventReceiver |
ActivityUpgraded, ActivityUpgrading, Added, Adding, CheckIn, Created, Creating, Deleted, Deleting, EntitiesDeleted, EntitiesDeleting, Published, Publishing, Saved, SaveFailed, Updated, Updating, WssWorkspaceAddressDeleted, WssWorkspaceAddressDeleting, WssWorkspaceUpdated, WssWorkspaceUpdating |
Admin |
AdminEventReceiver |
AdSyncERPSynchronized, AdSyncERPSynchronizing, AdSyncGroupsSynchronized, AdSyncGroupsSynchronizing, LineClassUpdating, AdSyncGroupSynchronized, AdSyncGroupSynchronizing, LineClassUpdated, ReportingPeriodUpdated, ReportingPeriodUpdating, StatusReportsDeleted, StatusReportsDeleting |
Calendar |
CalendarEventReceiver |
Changed, Changing, CheckedIn, CheckedOut, CheckingIn, CheckingOut, Created, Creating, Deleting, Deleted |
CubeAdmin |
CubeAdminEventReceiver |
CubeBuilding, CubeBuilt, CubeProcessed |
CustomFields |
CustomFieldsEventReceiver |
CheckedIn, CheckedOut, CheckingIn, CheckingOut, Created, Creating, Deleting, Deleted, Updated, Updating |
LookupTable |
LookupTableEventReceiver |
CheckedIn, CheckedOut, CheckingIn, CheckingOut, Created, Creating, Deleting, Deleted, Updated, Updating |
Notifications |
NotificationsEventReceiver |
Sending, Sent |
Reporting |
ReportingEventReceiver |
CustomFieldChanged, CustomFieldCreated, CustomFieldDeleted, FiscalPeriodChanged, FiscalPeriodDeleted, LookupTableChanged, LookupTableCreated, LookupTableDeleted, ProjectChanged, ProjectCreated, ProjectDeleted, ResourceCapacitiesChanged, ResourceCapacityTimeRangeChanged, ResourceChanged, ResourceCreated, ResourceDeleted, TimesheetAdjusted, TimesheetingClassChanged, TimesheetDeleted, TimesheetPeriodChanged, TimesheetPeriodCreated, TimesheetPeriodDeleted, TimesheetSaved, TimesheetStatusChanged, UserViewChanged |
Resource |
ResourceEventReceiver |
Activated, Activating, Changed, Changing, CheckedIn, CheckedOut, CheckingIn, CheckingOut, Created, Creating, Deactivated, Deactivating, Deleted, Deleting, Set Authorization, SettingAuthorization |
Rules |
RulesEventReceiver |
Copied, Copying, Created, Creating, Deleted, Deleting, Processed, Processing |
Security |
SecurityEventReceiver |
CategoryCreated, CategoryCreating, CategoryDeleted, CategoryDeleting, CategoryUpdated, CategoryUpdating, GroupCreated, GroupCreating, GroupDeleted, GroupDeleting, GroupUpdated, GroupUpdating, OrganizationPermissionsUpdated, OrganizationPermissionsUpdating, TemplateCreated, TemplateCreating, TemplateDeleted, TemplateDeleting, TemplateUpdated, TemplateUpdating |
Statusing |
StatusingEventReceiver |
Applied, Applying, ApprovalsUpdated, ApprovalsUpdating, AssignmentDelegated, AssignmentDelegating, AssignmentDeleted, AssignmentDeleting, AssignmentWorkDataSet, AssignmentWorkDataSetting, HistoryDeleted, HistoryDeleting, StatusSubmitted, StatusSubmitting, StatusUpdated, StatusUpdating, TaskCreated, TaskCreating |
StatusReports |
StatusReportsEventReceiver |
RequestCreated, RequestCreating, RequestUpdated, RequestUpdating, ResponseCreated, ResponseCreating, ResponseUpdated, ResponseUpdating |
TimeSheet |
TimesheetEventReveiver |
Created, Creating, Deleted, Deleting, LineApproved, LineApproving, Recalled, Recalling, Reviewed, Reviewing, Submitted, Submitting, Updated, Updating |
WssInterop |
WssInteropEventReceiver |
WssWorkspaceCreated, WssWorkspaceCreating |