C# Class 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.
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_mdc IFwMetaDataCache
m_rootClassId int
m_source System.Xml.XmlNode

Public Methods

Method Description
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.

Protected Methods

Method Description
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

Private Methods

Method Description
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

Method Details

Generate() public method

Generate the nodes that the constructor arguments indicate.
public Generate ( ) : System.Xml.XmlNode[]
return System.Xml.XmlNode[]

GeneratePartsFromLayouts() protected method

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
return List

GetGeneratedChildren() static public method

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.
return List

GetGeneratedChildren() static public method

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.
return List

InitMemberVariablesFromInput() protected method

initialize fields based on input node.
protected InitMemberVariablesFromInput ( IFwMetaDataCache mdc, XmlNode input ) : void
mdc IFwMetaDataCache
input System.Xml.XmlNode
return void

PartGenerator() public method

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
return System

PartGenerator() public method

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
return System

ReplaceParamsInAttributes() protected method

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
return void

Property Details

m_mdc protected_oe property

The metadata cache
protected IFwMetaDataCache m_mdc
return IFwMetaDataCache

m_rootClassId protected_oe property

class of item upon which to apply first layout
protected int m_rootClassId
return int

m_source protected_oe property

columnSpec
protected XmlNode,System.Xml m_source
return System.Xml.XmlNode