C# Class System.ComponentModel.Design.Serialization.MemberRelationshipService

A member relationship service is used by a serializer to announce that one property is related to a property on another object. Consider a code based serialization scheme where code is of the following form: object1.Property1 = object2.Property2 Upon interpretation of this code, Property1 on object1 will be set to the return value of object2.Property2. But the relationship between these two objects is lost. Serialization schemes that wish to maintain this relationship may install a MemberRelationshipService into the serialization manager. When an object is deserialized this serivce will be notified of these relationships. It is up to the service to act on these notifications if it wishes. During serialization, the service is also consulted. If a relationship exists the same relationship is maintained by the serializer.
ファイルを表示 Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
SupportsRelationship ( MemberRelationship source, MemberRelationship relationship ) : bool

Returns true if the provided relatinoship is supported.

Protected Methods

Method Description
GetRelationship ( MemberRelationship source ) : MemberRelationship

This is the implementation API for returning relationships. The default implementation stores the relationship in a table. Relationships are stored weakly, so they do not keep an object alive.

SetRelationship ( MemberRelationship source, MemberRelationship relationship ) : void

This is the implementation API for returning relationships. The default implementation stores the relationship in a table. Relationships are stored weakly, so they do not keep an object alive. Empty can be passed in for relationship to remove the relationship.

Private Methods

Method Description
this ( MemberRelationship source ) : MemberRelationship
this ( object sourceOwner, MemberDescriptor sourceMember ) : MemberRelationship

Method Details

GetRelationship() protected method

This is the implementation API for returning relationships. The default implementation stores the relationship in a table. Relationships are stored weakly, so they do not keep an object alive.
protected GetRelationship ( MemberRelationship source ) : MemberRelationship
source MemberRelationship
return MemberRelationship

SetRelationship() protected method

This is the implementation API for returning relationships. The default implementation stores the relationship in a table. Relationships are stored weakly, so they do not keep an object alive. Empty can be passed in for relationship to remove the relationship.
protected SetRelationship ( MemberRelationship source, MemberRelationship relationship ) : void
source MemberRelationship
relationship MemberRelationship
return void

SupportsRelationship() public abstract method

Returns true if the provided relatinoship is supported.
public abstract SupportsRelationship ( MemberRelationship source, MemberRelationship relationship ) : bool
source MemberRelationship
relationship MemberRelationship
return bool