C# Class SIL.FieldWorks.Common.Controls.LayoutMerger

A layout merger is used to merge a current version layout with an override that is an older version. Merging takes place broadly by copying the current version into a new XmlNode in a specified document. Currently most elements are copied unmodified. However, part refs are treated specially: Each consecutive sequence of part nodes is adjusted in the following ways: - order is made to conform to the order in the override, for any elements found in the override. - any elements not found in the override are copied, in the current sequence starting from the previous element that IS matched, and visibility set to "never". - (elements not matched in the override are discarded, except that) - "$child" elements in the override are copied to the output - a specified set of attributes may also be overridden.
Inheritance: IOldVersionMerger
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
Merge ( XmlNode newMaster, XmlNode oldConfigured, XmlDocument dest, string oldLayoutSuffix ) : XmlNode

This is the main entry point.

Private Methods

Method Description
BuildOldConfiguredPartsDicts ( ) : void
CheckForAndReattachLayoutParamSuffix ( XmlNode workingNode ) : void
CopyAttributes ( XmlNode source, XmlNode dest ) : void
CopyNodesNotInOldConfigured ( int index, int limIndex ) : int

Copy nodes from index to limIndex to output, stopping if a node is found that has a key in m_oldPartsFound. Return the index of the next (uncopied) node, either limIndex or the index of the node with a key we still want.

CopyParts ( int startIndex, int limIndex ) : void
CopySafeAttrs ( XmlNode copy, XmlNode oldConfiguredPartRef ) : void
CopyStuffWantedForNewNode ( XmlNode oldNode, int indexOfFirstNodeWanted, int limIndex ) : void
CopyToOutput ( XmlNode source ) : XmlNode
FixUpPartRefLabelAttrForDupNode ( XmlNode partRefNode, string dupKey ) : void
FixUpPartRefParamAttrForDupNode ( XmlNode partRefNode, string dupKey ) : void
GetKey ( XmlNode node ) : string
GetKeyWithDup ( XmlNode node ) : string
IsMergeableNode ( XmlNode currentChild ) : bool
ReattachDupSuffixes ( XmlNode copy, string dupKey ) : void
WantToCopyMissingItem ( XmlNode node ) : bool

Method Details

Merge() public method

This is the main entry point.
public Merge ( XmlNode newMaster, XmlNode oldConfigured, XmlDocument dest, string oldLayoutSuffix ) : XmlNode
newMaster System.Xml.XmlNode
oldConfigured System.Xml.XmlNode
dest System.Xml.XmlDocument
oldLayoutSuffix string
return System.Xml.XmlNode