API Help
Eplan.EplApi.DataModel Namespace / ProjectEventsProvider Class
Members Example

In This Topic
    ProjectEventsProvider Class
    In This Topic
    This class provides notifications about project changes.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.DataModel.ProjectEventsProvider

    Syntax
    public sealed class ProjectEventsProvider 
    public ref class ProjectEventsProvider sealed 
    Remarks
    ProjectEventsProvider tracks changes made only by current instance of P8. When making changes, please use Eplan.EplApi.HEServices.ChangeInfoService in order to disable notification and avoid infinite recursion.
    Example
    The following example shows how to use class ProjectEventsProvider.
    public class EventListener : IDisposable
    {
        public EventListener()
        {
            oProjectEventsProvider.AddAnyChangeHandler(
                AnyChangeEvent_Handler);
        }
        public void Dispose()
        {
            oProjectEventsProvider.RemoveAnyChangeHandler(
                AnyChangeEvent_Handler);
        }
        public void AnyChangeEvent_Handler(StorableObject[] createdObjects, StorableObject[] changedObjects, String[] destroyedObjects)
        {
            foreach (StorableObject oStorableObject in createdObjects)
            {
                if (oStorableObject is Function)
                {
                    Function oFunction = oStorableObject as Function;
                    System.Console.WriteLine("Function created : " + oFunction.Name);
                }
            }
        }
        private ProjectEventsProvider oProjectEventsProvider = new ProjectEventsProvider();
    }
    EventListener oEventListener = new EventListener();
    
    
    Public Constructors
     NameDescription
    Public ConstructorConstructor  
    Top
    Public Methods
     NameDescription
    Public MethodAdds project events handler  
    Public MethodDestructor for deterministic finalization of ProjectEventsProvider object.  
    Public MethodRemoves project events handler  
    Top
    See Also