How to use/consume events?

Apr 29, 2011 at 1:58 PM

I didn´t find a sample how to use/consume events from project.

Any suggestions?

Regards,
Carlo

Apr 29, 2011 at 2:13 PM
Edited Apr 29, 2011 at 2:14 PM

Hi, I dont have much time right now, but to get you on the right track here is goes:

1. you need to create a class library dll like with at least one class, here is an example for project events and the Saved event:

public class MyProjectEvents : Microsoft.Office.Project.Server.Events.ProjectEventReceiver
    {
        public override void OnSaved(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            //Do your stuff here

            base.OnSaved(contextInfo, e);
        }
    }

2. Be sure to sign the projects assembly with string name and compile.

3. put the .dll in the GAC on the server.

4. Register the dll in the PWA site.

Go to Server Settings -> Server Side Event Handlers.

Find Events source Project and enter values and clicik on New Event Handler.

Enter the nesesary info.

Got to run, but I just found a link describing it well:

http://msdn.microsoft.com/en-us/library/gg615466.aspx

 

Best regards,

Hans Christian Ihlen

Coordinator
May 4, 2011 at 12:59 PM

Hi Rushmore,

 

Please find a code sample in "Samples" solution.

The file "Samples\Migrator\EventHandlersDeploymentTest.cs" contains both event receiver class ("TestProjectEventHandler") and deployment code snippet ("EventHandlersDeploymentTest" class). 

 

BR,

Viacheslav