C# Класс SIL.FieldWorks.Common.Controls.PartGenerator

PartGenerator takes as input elements with attributes like class="LexSense" fieldType="mlstring" restrictions="customOnly" and generates a sequence of clones of the first non-comment child of the generate element, one for each field indicated by the parameters.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
m_mdc IFwMetaDataCache
m_rootClassId int
m_source System.Xml.XmlNode

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

Метод Описание
Generate ( ) : System.Xml.XmlNode[]

Generate the nodes that the constructor arguments indicate.

GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache ) : List

Return an array list of the non-comment children of root, except that any "generate" elements are replaced with what they generate. This is for generating parts that are completely defined in the xml root. For generating parts through "layouts" use the interface that passes a Vc.

GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache, string keyAttrNames ) : List

Return an array list of the non-comment children of root, except that any "generate" elements are replaced with what they generate.

PartGenerator ( SIL.FieldWorks.FDO.FdoCache cache, XmlNode input ) : System

Make a part generator for the specified "generate" element, interpreting names using the specified metadatacache. Doesn't handle generate nodes refering to layouts. Use the constructor with Vc for that.

PartGenerator ( SIL.FieldWorks.FDO.FdoCache cache, XmlNode input, XmlVc vc, int rootClassId ) : System

Make a part generator for the specified "generate" element, interpreting names using the specified metadatacache, using vc and rootClassId for handling generate nodes that refer to layouts.

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

Метод Описание
GeneratePartsFromLayouts ( int layoutClass, string fieldNameForReplace, int fieldIdForWs, XmlNode &layoutNode ) : List

make sure we can get a PartNode for this child, if not, try to (recursively) generate parts refering to the parent(s) until we can find the owner of the layout. clone this (generic) part: into this (specific) part:

InitMemberVariablesFromInput ( IFwMetaDataCache mdc, XmlNode input ) : void

initialize fields based on input node.

ReplaceParamsInAttributes ( XmlNode output, string labelName, string fieldName, int customFieldId, string className ) : void

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

Метод Описание
Accept ( int flid ) : bool

This is the definition of what it means for a field to pass all current restrictions.

AppendClassAttribute ( XmlNode output, string fieldName, string className ) : void
GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache, XmlVc vc, int rootClassId ) : List

Return an array list of the non-comment children of root, except that any "generate" elements are replaced with what they generate.

GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache, string keyAttrNames, XmlVc vc, int rootClassId ) : List

MatchNodes ( XmlNode matchNode, XmlNode genNode, string keyAttrNames ) : bool

Answer true if the name and every attr specified in keyAttrNames matches.

SetupWsParams ( XmlNode output, int fieldId ) : void

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

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

Generate the nodes that the constructor arguments indicate.
public Generate ( ) : System.Xml.XmlNode[]
Результат System.Xml.XmlNode[]

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

make sure we can get a PartNode for this child, if not, try to (recursively) generate parts refering to the parent(s) until we can find the owner of the layout. clone this (generic) part: into this (specific) part:
protected GeneratePartsFromLayouts ( int layoutClass, string fieldNameForReplace, int fieldIdForWs, XmlNode &layoutNode ) : List
layoutClass int
fieldNameForReplace string
fieldIdForWs int
layoutNode System.Xml.XmlNode
Результат List

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

Return an array list of the non-comment children of root, except that any "generate" elements are replaced with what they generate. This is for generating parts that are completely defined in the xml root. For generating parts through "layouts" use the interface that passes a Vc.
static public GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache ) : List
root System.Xml.XmlNode The root.
cache SIL.FieldWorks.FDO.FdoCache The FDO cache.
Результат List

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

Return an array list of the non-comment children of root, except that any "generate" elements are replaced with what they generate.
static public GetGeneratedChildren ( XmlNode root, SIL.FieldWorks.FDO.FdoCache cache, string keyAttrNames ) : List
root System.Xml.XmlNode The root.
cache SIL.FieldWorks.FDO.FdoCache The FDO cache.
keyAttrNames string if non-null, gives a list of key attribute names. /// generated children which match another node in root in all key attributes are omitted.
Результат List

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

initialize fields based on input node.
protected InitMemberVariablesFromInput ( IFwMetaDataCache mdc, XmlNode input ) : void
mdc IFwMetaDataCache
input System.Xml.XmlNode
Результат void

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

Make a part generator for the specified "generate" element, interpreting names using the specified metadatacache. Doesn't handle generate nodes refering to layouts. Use the constructor with Vc for that.
public PartGenerator ( SIL.FieldWorks.FDO.FdoCache cache, XmlNode input ) : System
cache SIL.FieldWorks.FDO.FdoCache
input System.Xml.XmlNode
Результат System

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

Make a part generator for the specified "generate" element, interpreting names using the specified metadatacache, using vc and rootClassId for handling generate nodes that refer to layouts.
public PartGenerator ( SIL.FieldWorks.FDO.FdoCache cache, XmlNode input, XmlVc vc, int rootClassId ) : System
cache SIL.FieldWorks.FDO.FdoCache
input System.Xml.XmlNode
vc XmlVc for parts/layouts
rootClassId int class of root object from which column layouts can be computed
Результат System

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

protected ReplaceParamsInAttributes ( XmlNode output, string labelName, string fieldName, int customFieldId, string className ) : void
output System.Xml.XmlNode
labelName string
fieldName string
customFieldId int
className string
Результат void

Описание свойств

m_mdc защищенное свойство

The metadata cache
protected IFwMetaDataCache m_mdc
Результат IFwMetaDataCache

m_rootClassId защищенное свойство

class of item upon which to apply first layout
protected int m_rootClassId
Результат int

m_source защищенное свойство

columnSpec
protected XmlNode,System.Xml m_source
Результат System.Xml.XmlNode