0

How do I use different event arguments like DocumentSaveToLocalProgressChangedEventArgs during the different phases in the WorksharedOperationProgressChanged event. I know how to subscribe to the WorksharedOperationProgressChanged event but haven't been able to figure out how to use different event arguments.

I guess there is some basic C# concept about events I am missing, but I haven't found an answer in any tutorial or documentation that would explain what I should do in this case.

2 Answers2

0

Revit calls your event handler with the specified argument. You have no choice what arguments your receive. They are pre-specified by the event handler definition. Your question is moot.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • I am still trying to figure this out. I understand that I don't have a choice what argument I get but how do I use it to get the properties? – Adrian Albisser Dec 17 '18 at 03:05
0

What properties are you trying to access?

Here is how to subscribe to the event and access the model path:

public Result OnStartup( UIControlledApplication a )
{
  a.ControlledApplication
    .WorksharedOperationProgressChanged 
      += OnWorksharedOperationProgressChanged;
  return Result.Succeeded;
}

void OnWorksharedOperationProgressChanged( 
  object sender, 
  WorksharedOperationProgressChangedEventArgs e )
{
  string path = e.Location;
}
Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • I am trying to access the properties for the different phases in `WorksharedOperationProgressChanged` event like Speed property in the `DataTransferProgressChangedEventArgs` Class. – Adrian Albisser Dec 19 '18 at 04:22