C# Класс SIL.FieldWorks.FDO.Infrastructure.FdoMetaDataCacheDecoratorBase

Implementation of the IFwMetaDataCacheManaged interface which works with a stateful FDO system for most data issues. For cases where there is a need to store 'fake' data (i.e., not properties of CmObjects), clients should subclass this class and override the relevant methods and read/write that fake meta data in their own internal caches. They should pass the request through to the FdoMetaDataCache (IFwMetaDataCacheManaged) for regular metadata access.
Наследование: IFwMetaDataCacheManaged
Показать файл Открыть проект

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

Метод Описание
AddVirtualProp ( string bstrClass, string bstrField, int luFlid, int type ) : void

A virtual property. The type can be one of the original types, or any other made up type.

This method must be overridden by subclasses, so they can add non-model properties.

ClassExists ( string className ) : bool

Pass it on by default.

FieldExists ( int flid ) : bool

Return true if the specified field exists.

FieldExists ( int classId, string fieldName, bool includeBaseClasses ) : bool

Pass it on by default.

FieldExists ( string className, string fieldName, bool includeBaseClasses ) : bool

Pass it on by default.

GetAbstract ( int luClid ) : bool

Indicates whether a class is abstract or concrete.

GetAllSubclasses ( int luClid, int cluMax, int &_cluOut, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgluSubclasses ) : void

Gets all subclasses of the given class, including itself (which is always the first result in the list, so it can easily be skipped if desired). The list is therefore a complete list of the classes which are valid to store in a property whose signature is the class identified by luClid.

GetBaseClsId ( int luClid ) : int

Gets the base class id for a given class.

GetBaseClsName ( int luClid ) : string

Gets the name of the base class for a given class.

GetClassId ( string bstrClassName ) : int

:>:> Reverse access methods :> Get the ID of the class having the specified name. Returns 0 if not found.

GetClassIds ( int cclid, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgclid ) : void

Gets the list of class identification numbers (in no particular order). If the array provided is too small, only an arbitrary subset of cclid values is returned. If the array provided is too large, the excess entries are set to zero.

GetClassName ( int luClid ) : string

Gets the name of the class.

GetDirectSubclasses ( int luClid, int cluMax, int &_cluOut, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgluSubclasses ) : void

Gets the direct subclasses of the given class (not including itself).

GetDstClsId ( int luFlid ) : int

Gets the "Id" of the destination class that corresponds to this field. This is the "Id" of the class that is either owned or referred to by another class.

GetDstClsName ( int luFlid ) : string

Gets the name of the destination class that corresponds to this field. This is the name of the class that is either owned or referred to by another class.

GetFieldHelp ( int luFlid ) : string

Gets the help string of a field.

GetFieldId ( string bstrClassName, string bstrFieldName, bool fIncludeBaseClasses ) : int

Gets the field ID given the class and field names. Returns 0 if not found. Searches superclasses as well as actual class given.

GetFieldId2 ( int luClid, string bstrFieldName, bool fIncludeBaseClasses ) : int

This is more efficient if the client already has the classID specified classID and field name. Returns 0 if not found. Searches superclasses as well as actual class given.

GetFieldIds ( int cflid, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgflid ) : void

Gets the list of field identification numbers (in no particular order). If the array provided is too small, only an arbitrary set of cflid values is returned. If the array provided is too large, the excess entries are set to zero.

GetFieldLabel ( int luFlid ) : string

Gets the user label of a field.

GetFieldListRoot ( int luFlid ) : System.Guid

Gets the listRoot of the field.

GetFieldName ( int luFlid ) : string

Gets the name of a field.

GetFieldNameOrNull ( int luFlid ) : string

Gets the name of a field.

GetFieldType ( int luFlid ) : int

Gets the type of the field. This value indicates if the field is a primitive data type or a MultiStr/MultiTxt value or describes the relationship between two classes (i.e. owning/reference and atomic/collection/sequence). These numeric values are defined in the ~FWROOT\src\cellar\lib\CmTypes.h file.

GetFieldWs ( int luFlid ) : int

Gets the Ws of the field.

GetFieldXml ( int luFlid ) : string

Gets the Xml UI of a field.

GetFields ( int luClid, bool fIncludeSuperclasses, int grfcpt, int cflidMax, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgflid ) : int

Gets a list of the fields for the specified class. Gets all fields whose types match the specified argument, which should be a combination of the fcpt values defined in CmTypes.h, e.g., to get all owning properties pass kfcptOwningCollection | kfcptOwningAtom | kfcptOwningSequence. Returns E_FAIL if the array is too small. cflidMax 0 may be passed to obtain the required size. Fields of superclasses are also returned, if the relevant flag is true. [Note: The special CmObject fields are not returned, for now, but the plan to include them before too long.]

GetIncomingFields ( int clid, int fieldTypes ) : IEnumerable

Pass it on. Only real fields are interesting here.

GetOwnClsId ( int luFlid ) : int

Gets the "Id" value of the class that contains this field.

GetOwnClsName ( int luFlid ) : string

Gets the name of the class that contains this field.

InitXml ( string bstrPathname, bool fClearPrevCache ) : void

Alternative way to initialize, passing an XML file (like Ling.cm). <class num="int" id="className" base="baseClassName" abstract="true"> <props> <basic num="int" id="FieldName" sig="Boolean/Integer/Time/String/MultiString/MultiUnicode" /> <rel/owning num="int" id="FieldName" card="atomic/seq/col" sig="classname"/> currently doesn't initialize some less essential stuff like help strings and labels. Set fClearPrevCache to false to read in multiple XML files. Enhance JohnT: support attributes to handle these.

IsValueType ( CellarPropertyType type ) : bool

Returns true for Binary, Boolean, GenDate, Integer and Time

get_IsValidClass ( int luFlid, int luClid ) : bool

Given a field id and a class id, this returns true it it is legal to store this class of object in the field.

get_IsVirtual ( int luFlid ) : bool

Защищенные методы

Метод Описание
FdoMetaDataCacheDecoratorBase ( IFwMetaDataCacheManaged metaDataCache ) : System

Constructor.

The hvo values are true 'handles' in that they are valid for one session, but may not be the same integer for another session for the 'same' object. Therefore, one should not use them for multi-session identity. CmObject identity can only be guaranteed by using their Guids (or using '==' in code).

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

Метод Описание
AddCustomField ( string className, string fieldName, CellarPropertyType fieldType, int destinationClass ) : int
AddCustomField ( string className, string fieldName, CellarPropertyType fieldType, int destinationClass, string fieldHelp, int fieldWs, System.Guid fieldListRoot ) : int
DeleteCustomField ( int flid ) : void
GetAllSubclasses ( int clid ) : int[]
GetClassIds ( ) : int[]
GetDirectSubclasses ( int clid ) : int[]
GetFieldIds ( ) : int[]
GetFields ( int clid, bool includeSuperclasses, int fieldTypes ) : int[]
IsCustom ( int flid ) : bool
UpdateCustomField ( int flid, string fieldHelp, int fieldWs, string userLabel ) : void

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

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

A virtual property. The type can be one of the original types, or any other made up type.
This method must be overridden by subclasses, so they can add non-model properties.
public abstract AddVirtualProp ( string bstrClass, string bstrField, int luFlid, int type ) : void
bstrClass string
bstrField string
luFlid int
type int
Результат void

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

Pass it on by default.
public ClassExists ( string className ) : bool
className string
Результат bool

FdoMetaDataCacheDecoratorBase() защищенный Метод

Constructor.
The hvo values are true 'handles' in that they are valid for one session, but may not be the same integer for another session for the 'same' object. Therefore, one should not use them for multi-session identity. CmObject identity can only be guaranteed by using their Guids (or using '==' in code).
protected FdoMetaDataCacheDecoratorBase ( IFwMetaDataCacheManaged metaDataCache ) : System
metaDataCache IFwMetaDataCacheManaged The FDO FdoMetaDataCache implementation, /// which is used to get the basic FDO data.
Результат System

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

Return true if the specified field exists.
public FieldExists ( int flid ) : bool
flid int
Результат bool

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

Pass it on by default.
public FieldExists ( int classId, string fieldName, bool includeBaseClasses ) : bool
classId int
fieldName string
includeBaseClasses bool
Результат bool

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

Pass it on by default.
public FieldExists ( string className, string fieldName, bool includeBaseClasses ) : bool
className string
fieldName string
includeBaseClasses bool
Результат bool

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

Indicates whether a class is abstract or concrete.
public GetAbstract ( int luClid ) : bool
luClid int Class identification number. In the database, this corresponds to "Id" /// column in the Class$ table.
Результат bool

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

Gets all subclasses of the given class, including itself (which is always the first result in the list, so it can easily be skipped if desired). The list is therefore a complete list of the classes which are valid to store in a property whose signature is the class identified by luClid.
public GetAllSubclasses ( int luClid, int cluMax, int &_cluOut, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgluSubclasses ) : void
luClid int
cluMax int
_cluOut int
_rgluSubclasses SIL.FieldWorks.Common.COMInterfaces.ArrayPtr
Результат void

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

Gets the base class id for a given class.
public GetBaseClsId ( int luClid ) : int
luClid int Class identification number. In the database, this corresponds to "Id" /// column in the Class$ table.
Результат int

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

Gets the name of the base class for a given class.
public GetBaseClsName ( int luClid ) : string
luClid int Class identification number. In the database, this corresponds to "Id" /// column in the Class$ table.
Результат string

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

:>:> Reverse access methods :> Get the ID of the class having the specified name. Returns 0 if not found.
public GetClassId ( string bstrClassName ) : int
bstrClassName string
Результат int

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

Gets the list of class identification numbers (in no particular order). If the array provided is too small, only an arbitrary subset of cclid values is returned. If the array provided is too large, the excess entries are set to zero.
public GetClassIds ( int cclid, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgclid ) : void
cclid int The size of the output array.
rgclid SIL.FieldWorks.Common.COMInterfaces.ArrayPtr An integer array for returning the class identification numbers.
Результат void

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

Gets the name of the class.
public GetClassName ( int luClid ) : string
luClid int Class identification number. In the database, this corresponds to "Id" /// column in the Class$ table.
Результат string

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

Gets the direct subclasses of the given class (not including itself).
public GetDirectSubclasses ( int luClid, int cluMax, int &_cluOut, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgluSubclasses ) : void
luClid int
cluMax int
_cluOut int
_rgluSubclasses SIL.FieldWorks.Common.COMInterfaces.ArrayPtr
Результат void

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

Gets the "Id" of the destination class that corresponds to this field. This is the "Id" of the class that is either owned or referred to by another class.
public GetDstClsId ( int luFlid ) : int
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат int

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

Gets the name of the destination class that corresponds to this field. This is the name of the class that is either owned or referred to by another class.
public GetDstClsName ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets the help string of a field.
public GetFieldHelp ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets the field ID given the class and field names. Returns 0 if not found. Searches superclasses as well as actual class given.
public GetFieldId ( string bstrClassName, string bstrFieldName, bool fIncludeBaseClasses ) : int
bstrClassName string
bstrFieldName string
fIncludeBaseClasses bool
Результат int

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

This is more efficient if the client already has the classID specified classID and field name. Returns 0 if not found. Searches superclasses as well as actual class given.
public GetFieldId2 ( int luClid, string bstrFieldName, bool fIncludeBaseClasses ) : int
luClid int
bstrFieldName string
fIncludeBaseClasses bool
Результат int

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

Gets the list of field identification numbers (in no particular order). If the array provided is too small, only an arbitrary set of cflid values is returned. If the array provided is too large, the excess entries are set to zero.
public GetFieldIds ( int cflid, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgflid ) : void
cflid int The size of the output array.
rgflid SIL.FieldWorks.Common.COMInterfaces.ArrayPtr An integer array for returning the field identification numbers.
Результат void

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

Gets the user label of a field.
public GetFieldLabel ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets the listRoot of the field.
public GetFieldListRoot ( int luFlid ) : System.Guid
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат System.Guid

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

Gets the name of a field.
public GetFieldName ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets the name of a field.
public GetFieldNameOrNull ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets the type of the field. This value indicates if the field is a primitive data type or a MultiStr/MultiTxt value or describes the relationship between two classes (i.e. owning/reference and atomic/collection/sequence). These numeric values are defined in the ~FWROOT\src\cellar\lib\CmTypes.h file.
public GetFieldType ( int luFlid ) : int
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table. /// Historical note: at one point, the result could include the virtual bit, kcptVirtual, or'd /// with one of the other kcpt values. This caused endless bugs and has been removed.
Результат int

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

Gets the Ws of the field.
public GetFieldWs ( int luFlid ) : int
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат int

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

Gets the Xml UI of a field.
public GetFieldXml ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Gets a list of the fields for the specified class. Gets all fields whose types match the specified argument, which should be a combination of the fcpt values defined in CmTypes.h, e.g., to get all owning properties pass kfcptOwningCollection | kfcptOwningAtom | kfcptOwningSequence. Returns E_FAIL if the array is too small. cflidMax 0 may be passed to obtain the required size. Fields of superclasses are also returned, if the relevant flag is true. [Note: The special CmObject fields are not returned, for now, but the plan to include them before too long.]
public GetFields ( int luClid, bool fIncludeSuperclasses, int grfcpt, int cflidMax, SIL.FieldWorks.Common.COMInterfaces.ArrayPtr _rgflid ) : int
luClid int
fIncludeSuperclasses bool
grfcpt int
cflidMax int
_rgflid SIL.FieldWorks.Common.COMInterfaces.ArrayPtr
Результат int

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

Pass it on. Only real fields are interesting here.
public GetIncomingFields ( int clid, int fieldTypes ) : IEnumerable
clid int
fieldTypes int
Результат IEnumerable

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

Gets the "Id" value of the class that contains this field.
public GetOwnClsId ( int luFlid ) : int
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат int

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

Gets the name of the class that contains this field.
public GetOwnClsName ( int luFlid ) : string
luFlid int Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table.
Результат string

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

Alternative way to initialize, passing an XML file (like Ling.cm). <class num="int" id="className" base="baseClassName" abstract="true"> <props> <basic num="int" id="FieldName" sig="Boolean/Integer/Time/String/MultiString/MultiUnicode" /> <rel/owning num="int" id="FieldName" card="atomic/seq/col" sig="classname"/> currently doesn't initialize some less essential stuff like help strings and labels. Set fClearPrevCache to false to read in multiple XML files. Enhance JohnT: support attributes to handle these.
public InitXml ( string bstrPathname, bool fClearPrevCache ) : void
bstrPathname string
fClearPrevCache bool
Результат void

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

Returns true for Binary, Boolean, GenDate, Integer and Time
public IsValueType ( CellarPropertyType type ) : bool
type CellarPropertyType
Результат bool

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

Given a field id and a class id, this returns true it it is legal to store this class of object in the field.
public get_IsValidClass ( int luFlid, int luClid ) : bool
luFlid int Field identification number.
luClid int Class identification number.
Результат bool

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

public get_IsVirtual ( int luFlid ) : bool
luFlid int
Результат bool