C# Класс SIL.FieldWorks.FDO.DomainServices.GhostParentHelper

This class helps manage "ghost" virtual properties. The characteristic of such a property is that it contains a mixture of objects of a 'signature' class (or a subclass) and objects of a 'parent' class, which are put into the list when they have no children of the signature class in a specified owning property. Bulk edit operations may insert a suitable child if necessary to set a value for a parent-type object.
Показать файл Открыть проект

Открытые методы

Метод Описание
Create ( IFdoServiceLocator services, string classDotMethod ) : GhostParentHelper

Returns GPHs for the four properties we currently know about.

CreateIfPossible ( IFdoServiceLocator services, int flid ) : GhostParentHelper

Return a ghost parent helper based on a flid, or null if this flid does not need one.

CreateIfPossible ( IFdoServiceLocator services, string classDotMethod ) : GhostParentHelper

Returns GPHs for the four properties we currently know about, or null if not a known property that has ghosts.

FindOrCreateOwnerOfTargetProp ( int hvoItem, int flidBasicProp ) : int

Like GetOwnerOfTargetProperty, but will create a child if necessary so as never to return zero. Caller must ensure we are in a UOW.

GetBulkEditDestinationClass ( FdoCache cache, int listFlid ) : int

Get the destination class for the specified flid, as used in bulk edit. For this purpose we need to override the destination class of the fields that have ghost parent helpers, since the properties hold a mixture of classes and therefore have CmObject as their signature, but the bulk edit code needs to treat them as having the class they primarily contain.

GetOwnerOfTargetProperty ( int hvo ) : int

Get the object related to hvo that has the basic properties of interest: that is, a child object. hvo is assumed to be the desired object unless it is of the parent class, in which case, we return its first child if any, or zero if it has no relevant children.

IsGhostOwnerChildless ( int hvoItem ) : bool

Return true if the target object (which must be of the owner class) has no children in the relevant property.

IsGhostOwnerClass ( int hvo ) : bool

Return true if the object represented by the HVO is of the parent object class. Enhance JohnT: improve name!

Приватные методы

Метод Описание
ClassToCreate ( int hvoItem, int flidBasicProp ) : int

Override if you should always create a particular class.

CreateOwnerOfTargetProp ( int hvoItem, int flidBasicProp ) : int

create the first child for this ghost owner

GetFirstChildFromParent ( int hvoParent ) : int
GetSda ( ) : ISilDataAccessManaged
GhostParentHelper ( IFdoServiceLocator services, int parentClsid, int flidOwning ) : System
IsOwningPropVector ( ) : bool

Описание методов

Create() публичный статический Метод

Returns GPHs for the four properties we currently know about.
public static Create ( IFdoServiceLocator services, string classDotMethod ) : GhostParentHelper
services IFdoServiceLocator
classDotMethod string
Результат GhostParentHelper

CreateIfPossible() публичный статический Метод

Return a ghost parent helper based on a flid, or null if this flid does not need one.
public static CreateIfPossible ( IFdoServiceLocator services, int flid ) : GhostParentHelper
services IFdoServiceLocator
flid int
Результат GhostParentHelper

CreateIfPossible() публичный статический Метод

Returns GPHs for the four properties we currently know about, or null if not a known property that has ghosts.
public static CreateIfPossible ( IFdoServiceLocator services, string classDotMethod ) : GhostParentHelper
services IFdoServiceLocator
classDotMethod string
Результат GhostParentHelper

FindOrCreateOwnerOfTargetProp() публичный Метод

Like GetOwnerOfTargetProperty, but will create a child if necessary so as never to return zero. Caller must ensure we are in a UOW.
public FindOrCreateOwnerOfTargetProp ( int hvoItem, int flidBasicProp ) : int
hvoItem int
flidBasicProp int
Результат int

GetBulkEditDestinationClass() публичный статический Метод

Get the destination class for the specified flid, as used in bulk edit. For this purpose we need to override the destination class of the fields that have ghost parent helpers, since the properties hold a mixture of classes and therefore have CmObject as their signature, but the bulk edit code needs to treat them as having the class they primarily contain.
public static GetBulkEditDestinationClass ( FdoCache cache, int listFlid ) : int
cache FdoCache
listFlid int
Результат int

GetOwnerOfTargetProperty() публичный Метод

Get the object related to hvo that has the basic properties of interest: that is, a child object. hvo is assumed to be the desired object unless it is of the parent class, in which case, we return its first child if any, or zero if it has no relevant children.
public GetOwnerOfTargetProperty ( int hvo ) : int
hvo int
Результат int

IsGhostOwnerChildless() публичный Метод

Return true if the target object (which must be of the owner class) has no children in the relevant property.
public IsGhostOwnerChildless ( int hvoItem ) : bool
hvoItem int
Результат bool

IsGhostOwnerClass() публичный Метод

Return true if the object represented by the HVO is of the parent object class. Enhance JohnT: improve name!
public IsGhostOwnerClass ( int hvo ) : bool
hvo int
Результат bool