Chili.Opf3 Send comments on this topic.
IRelationsNotification Interface
See Also  Members   Example
Chili.Opf3 Namespace : IRelationsNotification Interface




This interface is implemented by classes that need information on the persist of related persistent objects.

Syntax

Visual Basic (Declaration) 
Public Interface IRelationsNotification 
Visual Basic (Usage)Copy Code
Dim instance As IRelationsNotification
C# 
public interface IRelationsNotification 
Managed Extensions for C++ 
public __gc __interface IRelationsNotification 
C++/CLI 
public interface class IRelationsNotification 

Example

The following example shows how to implement the interface in your own persistent classes.
C#Copy Code
             [Persistent("USER")] 
public class User : IRelationsNotification 

    void IRelationsNotification.OnBeforeRelationsPersist(RelationsNotificationEventArgs e) 
    { 
        if (e.PersistentOperation == PersistentOperations.Delete) 
        { 
            this.Calls.RemoveAll(); 
            e.Context.PersistChanges(this.Calls, PersistDepths.Flat); 
        } 
    } 
 
    // ... Other methods of the interface. 
 
    // ... Other properties and code. 

    

Remarks

Classes that need information about any persist of related persistents have to implement this interface to get notified about the changes. If the framework encounters a class implementing the interface the appropriate method is called while the related persistent objects are persisted.

Each method is called twice. Once before/after the relations marked with ChildFirst and the other time before/after the relations marked with ParentFirst are going to be saved. To understand which call is currently fired, check the PersistRelationship property of the RelationsNotificationEventArgs.

Requirements

Namespace: Chili.Opf3

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also