C# Class SIL.FieldWorks.XWorks.XmlDocConfigureDlg

Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
AddChildNodes void
AddUnspecifiedTypes void
AdjustAttributeValue void
AdjustLayoutName string
BuildLayoutTree List
BuildMainLayout LayoutTreeNode
CheckNodeAndChildren void
ChildNodesMatch bool
ComparePossibilitiesByName int
CopyAndRenameLayout void
CopyConfiguration void
CreateComboAndTreeItems void
CreateConfigurationCopies void
CreateWsSpecficLayoutType XmlNode
DeleteUnwantedConfigurations void
DetermineStateOfContextControls void
DisplayBeforeStyleControls void
DisplayComplexFormConfigControls void
DisplayContextControls void
DisplayControlsForAnyNode void
DisplayCurrentNodeDetails void
DisplayDetailsForAParentNode void
DisplayDetailsForLeafNode void
DisplayDetailsForRecursiveNode void
DisplayDetailsForTopLevelNode void
DisplayGramInfoConfigControls void
DisplaySenseConfigControls void
DisplayStyleControls void
DisplayTypeControls void
DisplayWritingSystemControls void
DuplicateLayout void
DuplicateLayoutSubtree LayoutTreeNode
EnableMoveDownButton bool
EnableMoveUpButton bool
EnableSenseConfigControls void
FindMatchingLayoutInMap LayoutTypeComboItem
FindMatchingNode LayoutTreeNode
FixEntryTypeList void
FixLexRelationTypeList void
FlattenPossibilityList List
From96dpiX int
From96dpiY int
GenerateNumStyleFromCheckBoxes string
GenerateWsLabelFromListView string
GetBaseLabel string
GetConfigFilePath string
GetIndexToMoveTypeDown int
GetIndexToMoveTypeUp int
GetIndexToMoveWsDown int
GetIndexToMoveWsUp int
GetSortedFlattenedComplexFormTypeList List
GetSortedFlattenedVariantTypeList List
GetUnspecifiedItemName string
HandleStylesBtn void
HideComplexFormConfigControls void
HideGramInfoConfigControls void
HideSenseConfigControls void
HideStyleControls void
InitializeComplexFormTypeList void
InitializeComponent void
InitializeMinorEntryTypeList void
InitializeRelationList void
InitializeVariantTypeList void
InitializeWsListView void
IsDirty bool
IsUnspecifiedPossibility bool
ListContainsGuid bool
LoadLayoutMapFromComboBox LayoutTypeComboItem>.Dictionary
MakeDivInParaChildNotVisible void
MakeParentParaIfDivInParaVisible void
MakeSuffixLayout string
MarkLayoutTreeNodesAsNew void
MoveControlVertically void
MoveEntryTypeListItem void
MoveListItem void
MoveRelationTypeListItem void
NodesMatch bool
OnDuplicateClick void
OnItemTypeItemCheck void
OnListItemsItemCheck void
OnListItemsSelectedIndexChanged void
OnMoveItemDownClick void
OnMoveItemUpClick void
OnWritingSystemsItemCheck void
PlaceContextControls void
ProcessChildNodes void
ProcessPartChildForDuplication void
ProcessPartChildrenForDuplication void
ProcessXMLConfigChanges void
RenameConfigurations void
RewriteComboBoxItemsAfterDelete void
RewriteComboBoxItemsAfterRename void
SaveModifiedLayouts void
SelectAllDefaultWritingSystems void
SelectDefaultWss void
SetActiveNode void
SetActiveNode void
SetCharacterStyles void
SetDefaultWritingSystem void
SetItemListLocations void
SetNewActiveConfiguration void
SetNumStyleCheckStates void
SetParagraphStyles void
SetStylesLists void
ShowComplexFormRelatedControls void
ShowSenseConfigControls void
StoreChildNodeInfo void
StoreComplexFormData void
StoreGramInfoData void
StoreNodeData void
StoreSenseConfigData void
UpdateLayoutName void
XmlDocConfigureDlg_FormClosed void
generateChooserHelpTopicID string
m_btnBeforeStyles_Click void
m_btnHelp_Click void
m_btnMoveDown_Click void
m_btnMoveUp_Click void
m_btnOK_Click void
m_btnRemove_Click void
m_btnRestoreDefaults_Click void
m_btnSetAll_Click void
m_btnStyles_Click void
m_cbDictType_SelectedIndexChanged void
m_cfgSenses_SensesBtnClicked void
m_cfgSenses_SizeChanged void
m_chkComplexFormsAsParagraphs_CheckedChanged void
m_chkDisplayData_CheckedChanged void
m_displaySenseInParaChecked void
m_linkConfigureHomograph_LinkClicked void
m_linkManageViews_LinkClicked void
m_lnkConfigureNow_LinkClicked void
m_tbAfter_GotFocus void
m_tbAfter_LostFocus void
m_tbBefore_GotFocus void
m_tbBefore_LostFocus void
m_tbBetween_GotFocus void
m_tbBetween_LostFocus void
m_tb_TextChanged void
m_tvParts_AfterCheck void
m_tvParts_AfterSelect void

Public Methods

Method Description
CheckDisposed ( ) : void
SetConfigDlgInfo ( XmlNode configurationParameters, FdoCache cache, FwStyleSheet styleSheet, IMainWindowDelegateCallbacks mainWindowDelegateCallbacks, Mediator mediator, string sLayoutPropertyName ) : void

Initialize the dialog after creating it.

XmlDocConfigureDlg ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnClosing ( CancelEventArgs e ) : void

Save the location and size for next time.

OnLoad ( EventArgs e ) : void

Overridden to defeat the standard .NET behavior of adjusting size by screen resolution. That is bad for this dialog because we remember the size, and if we remember the enlarged size, it just keeps growing. If we defeat it, it may look a bit small the first time at high resolution, but at least it will stay the size the user sets.

Private Methods

Method Description
AddChildNodes ( XmlNode layout, LayoutTreeNode ltnParent, int iStart ) : void
AddUnspecifiedTypes ( bool fstemBased, int cvarTypes, LayoutTreeNode ltn ) : void
AdjustAttributeValue ( XmlNode node, string sAttrName, string suffixCode ) : void
AdjustLayoutName ( string sName, string suffixCode ) : string
BuildLayoutTree ( XmlNode xnLayoutType ) : List
BuildMainLayout ( XmlNode config ) : LayoutTreeNode
CheckNodeAndChildren ( TreeNode node, bool val ) : void
ChildNodesMatch ( XmlNodeList firstNodeList, XmlNodeList secondNodeList ) : bool

This method should sort the node lists and call NodesMatch with each pair.

ComparePossibilitiesByName ( ICmPossibility x, ICmPossibility y ) : int
CopyAndRenameLayout ( string className, string layoutName, string suffixCode ) : void
CopyConfiguration ( XmlNode xnBaseConfig, string code, string label ) : void
CreateComboAndTreeItems ( string sLayoutType ) : void
CreateConfigurationCopies ( IEnumerable newViewsToCreate ) : void
CreateWsSpecficLayoutType ( XmlNode xnLayoutType, string sWsLabel, string sWsLayout, string sWsTag ) : XmlNode
DeleteUnwantedConfigurations ( IEnumerable viewsToDelete ) : void
DetermineStateOfContextControls ( ) : void
DisplayBeforeStyleControls ( bool fEnabled ) : void
DisplayComplexFormConfigControls ( bool fEnabled ) : void
DisplayContextControls ( bool fEnabled ) : void
DisplayControlsForAnyNode ( bool fEnabled ) : void
DisplayCurrentNodeDetails ( ) : void
DisplayDetailsForAParentNode ( bool fEnabled ) : void
DisplayDetailsForLeafNode ( bool fEnabled ) : void
DisplayDetailsForRecursiveNode ( bool fEnabled ) : void
DisplayDetailsForTopLevelNode ( ) : void
DisplayGramInfoConfigControls ( bool fEnabled ) : void
DisplaySenseConfigControls ( bool fEnabled ) : void
DisplayStyleControls ( bool fEnabled ) : void
DisplayTypeControls ( bool fEnabled ) : void
DisplayWritingSystemControls ( bool fEnabled ) : void
DuplicateLayout ( XmlNode xnLayout, string suffixCode, List duplicates ) : void

Fix the cloned layout for use as a duplicate.

DuplicateLayoutSubtree ( int iDup ) : LayoutTreeNode
EnableMoveDownButton ( ) : bool

The MoveDown button is enabled only when the current node is not the last child of its parent tree node, and the following node comes from the same actual layout. (Remember, the parts from a sublayout node appear as children of the the same tree node as any parts from the layout containing the sublayout.)

EnableMoveUpButton ( ) : bool

The MoveUp button is enabled only when the current node is not the first child of its parent tree node, and the preceding node comes from the same actual layout. (Remember, the parts from a sublayout node appear as children of the the same tree node as any parts from the sublayout node appear as children of the the same tree node as any parts from the layout containing the sublayout.)

EnableSenseConfigControls ( bool fEnabled ) : void
FindMatchingLayoutInMap ( string layoutId, LayoutTypeComboItem>.Dictionary layoutMap ) : LayoutTypeComboItem

Gets the layout item matching a given code from the Manage Views dialog.

FindMatchingNode ( LayoutTreeNode ltn, XmlNode node ) : LayoutTreeNode
FixEntryTypeList ( LayoutTreeNode ltn, string parentLayoutName ) : void
FixLexRelationTypeList ( LayoutTreeNode ltn ) : void
FlattenPossibilityList ( IEnumerable sequence ) : List
From96dpiX ( int input ) : int

Convert a distance that is right at 96 dpi to the current screen dpi

From96dpiY ( int input ) : int

Convert a distance that is right at 96 dpi to the current screen dpi

GenerateNumStyleFromCheckBoxes ( ) : string
GenerateWsLabelFromListView ( ) : string
GetBaseLabel ( IList nodes, List rgsLabels ) : string
GetConfigFilePath ( XmlNode xnConfig, string configDir ) : string
GetIndexToMoveTypeDown ( ListView sic ) : int
GetIndexToMoveTypeUp ( ListView sic ) : int
GetIndexToMoveWsDown ( ListView sic ) : int
GetIndexToMoveWsUp ( ListView sic ) : int
GetSortedFlattenedComplexFormTypeList ( ) : List
GetSortedFlattenedVariantTypeList ( ) : List
GetUnspecifiedItemName ( ItemTypeInfo info ) : string
HandleStylesBtn ( ComboBox combo, Action fixCombo, string defaultStyle ) : void

Returns the name of the style the user would like to select (null or empty if canceled).

HideComplexFormConfigControls ( ) : void
HideGramInfoConfigControls ( ) : void
HideSenseConfigControls ( ) : void
HideStyleControls ( ) : void
InitializeComplexFormTypeList ( ) : void
InitializeComponent ( ) : void
InitializeMinorEntryTypeList ( ) : void
InitializeRelationList ( ) : void
InitializeVariantTypeList ( ) : void
InitializeWsListView ( ) : void
IsDirty ( ) : bool

Return true if any changes have been made to the layout configuration.

IsUnspecifiedPossibility ( ItemTypeInfo info ) : bool
ListContainsGuid ( IList itemTypeList, Guid searchGuid, int &index ) : bool

Searches a list of ItemTypeInfo items for a specific Guid (usually representing an unspecified type 'possibility'. Out variable gives the index at which the Guid is found in the list, or -1 if not found.

LoadLayoutMapFromComboBox ( ) : LayoutTypeComboItem>.Dictionary
MakeDivInParaChildNotVisible ( LayoutTreeNode ltn, object sender ) : void
MakeParentParaIfDivInParaVisible ( LayoutTreeNode ltn ) : void
MakeSuffixLayout ( string code, string layoutName, string className ) : string
MarkLayoutTreeNodesAsNew ( IEnumerable rgltnStyle ) : void
MoveControlVertically ( Control ctl, int dy ) : void
MoveEntryTypeListItem ( int idx, int idxNew ) : void
MoveListItem ( int idx, int newIndex ) : void
MoveRelationTypeListItem ( int idx, int idxNew ) : void
NodesMatch ( XmlNode first, XmlNode second ) : bool
OnDuplicateClick ( object sender, EventArgs e ) : void
OnItemTypeItemCheck ( ItemCheckEventArgs e ) : void

We need to enforce one rule: at least one item must always be checked.

OnListItemsItemCheck ( object sender, ItemCheckEventArgs e ) : void
OnListItemsSelectedIndexChanged ( object sender, EventArgs e ) : void
OnMoveItemDownClick ( object sender, EventArgs e ) : void
OnMoveItemUpClick ( object sender, EventArgs e ) : void
OnWritingSystemsItemCheck ( ItemCheckEventArgs e ) : void

We need to enforce two rules: 1. At least one item must always be checked. 2. If a magic ("Default Analysis" etc) item is checked, then it is the only one that can be checked.

PlaceContextControls ( Control belowThis ) : void

Adjust the position of the context controls. If they need to go below a particular control, pass it as belowThis. To restore the original position pass null.

ProcessChildNodes ( XmlNodeList xmlNodeList, string className, LayoutTreeNode ltn ) : void

Walk the tree of child nodes, storing information for each <obj> or <seq> node.

ProcessPartChildForDuplication ( string className, XmlNode xnCaller, XmlNode xnField, string suffixCode, List duplicates ) : void
ProcessPartChildrenForDuplication ( string className, XmlNode xnCaller, XmlNodeList xmlNodeList, string suffixCode, List duplicates ) : void

Processes any part children for duplication purposes, does nothing on empty xmlNodeLists

ProcessXMLConfigChanges ( IDictConfigManager presenter ) : void
RenameConfigurations ( string>.IEnumerable viewsToRename ) : void
RewriteComboBoxItemsAfterDelete ( LayoutTypeComboItem>.Dictionary layoutMap ) : void
RewriteComboBoxItemsAfterRename ( LayoutTypeComboItem>.Dictionary layoutMap ) : void
SaveModifiedLayouts ( ) : void
SelectAllDefaultWritingSystems ( ) : void
SelectDefaultWss ( int wsDefault, int wsDefault2 ) : void
SetActiveNode ( LayoutTreeNode ltn, string className, string layoutName, string partRef ) : void
SetActiveNode ( string nodePath ) : void

Set the active node, based on a string generated by XmlVc.NodeIdentifier, which makes 3-part strings class:layoutName:partRef.

SetCharacterStyles ( ) : void
SetDefaultWritingSystem ( int wsWanted ) : void
SetItemListLocations ( ) : void
SetNewActiveConfiguration ( string newActiveConfig ) : void
SetNumStyleCheckStates ( ) : void
SetParagraphStyles ( ) : void
SetStylesLists ( ) : void
ShowComplexFormRelatedControls ( bool fChecked ) : void
ShowSenseConfigControls ( ) : void
StoreChildNodeInfo ( XmlNode xn, string className, LayoutTreeNode ltn ) : void
StoreComplexFormData ( LayoutTreeNode ltn ) : void
StoreGramInfoData ( LayoutTreeNode ltn ) : void
StoreNodeData ( LayoutTreeNode ltn ) : void
StoreSenseConfigData ( LayoutTreeNode ltn ) : void
UpdateLayoutName ( XmlNode node, string attrName, string code ) : void
XmlDocConfigureDlg_FormClosed ( object sender, FormClosedEventArgs e ) : void
generateChooserHelpTopicID ( string fromStr ) : string

Generates a possible help topic id from an identifying string, but does NOT check it for validity!

m_btnBeforeStyles_Click ( object sender, EventArgs e ) : void

Fire up the Styles dialog, and if necessary, reload the related combobox.

m_btnHelp_Click ( object sender, EventArgs e ) : void
m_btnMoveDown_Click ( object sender, EventArgs e ) : void
m_btnMoveUp_Click ( object sender, EventArgs e ) : void
m_btnOK_Click ( object sender, EventArgs e ) : void
m_btnRemove_Click ( object sender, EventArgs e ) : void
m_btnRestoreDefaults_Click ( object sender, EventArgs e ) : void
m_btnSetAll_Click ( object sender, EventArgs e ) : void
m_btnStyles_Click ( object sender, EventArgs e ) : void

Fire up the Styles dialog, and if necessary, reload the related combobox.

m_cbDictType_SelectedIndexChanged ( object sender, EventArgs e ) : void
m_cfgSenses_SensesBtnClicked ( object sender, EventArgs e ) : void
m_cfgSenses_SizeChanged ( object sender, System e ) : void
m_chkComplexFormsAsParagraphs_CheckedChanged ( object sender, EventArgs e ) : void
m_chkDisplayData_CheckedChanged ( object sender, EventArgs e ) : void

Tie the "Display Data" checkbox to the corresponding checkbox in the treeview.

m_displaySenseInParaChecked ( object sender, EventArgs e ) : void
m_linkConfigureHomograph_LinkClicked ( object sender, LinkLabelLinkClickedEventArgs e ) : void
m_linkManageViews_LinkClicked ( object sender, LinkLabelLinkClickedEventArgs e ) : void

Call the Dictionary Configuration Manager dialog when this "Manage Views" link text is clicked.

m_lnkConfigureNow_LinkClicked ( object sender, LinkLabelLinkClickedEventArgs e ) : void

Move to the first child node when this "Configure Now" link text is clicked.

m_tbAfter_GotFocus ( object sender, EventArgs e ) : void
m_tbAfter_LostFocus ( object sender, EventArgs e ) : void
m_tbBefore_GotFocus ( object sender, EventArgs e ) : void

When the focus returns, it's probably more useful to select at the end rather than selecting everything.

m_tbBefore_LostFocus ( object sender, EventArgs e ) : void

Users want to see visible spaces. The only way to do this is to select everything, and show the selection when the focus leaves for elsewhere.

m_tbBetween_GotFocus ( object sender, EventArgs e ) : void
m_tbBetween_LostFocus ( object sender, EventArgs e ) : void
m_tb_TextChanged ( object sender, EventArgs e ) : void

Certain characters are not allowed in XML, even escaped, including 0x0 through 0x1F. Prevent these characters from being entered. (actually, tabs and linebreaks are in that range and legal, but they cause other problems, so we remove them, too)

m_tvParts_AfterCheck ( object sender, TreeViewEventArgs e ) : void

Don't allow the top-level nodes to be unchecked! Also, tie the check boxes in the tree view to the "Display Data" checkbox if the user clicks on the tree view while that node is the current one displayed in detail.

LT-10472 says that not to restrict checkmarks for level 0.

m_tvParts_AfterSelect ( object sender, TreeViewEventArgs e ) : void

Method Details

CheckDisposed() public method

public CheckDisposed ( ) : void
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

OnClosing() protected method

Save the location and size for next time.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs
return void

OnLoad() protected method

Overridden to defeat the standard .NET behavior of adjusting size by screen resolution. That is bad for this dialog because we remember the size, and if we remember the enlarged size, it just keeps growing. If we defeat it, it may look a bit small the first time at high resolution, but at least it will stay the size the user sets.
protected OnLoad ( EventArgs e ) : void
e EventArgs
return void

SetConfigDlgInfo() public method

Initialize the dialog after creating it.
public SetConfigDlgInfo ( XmlNode configurationParameters, FdoCache cache, FwStyleSheet styleSheet, IMainWindowDelegateCallbacks mainWindowDelegateCallbacks, Mediator mediator, string sLayoutPropertyName ) : void
configurationParameters XmlNode
cache FdoCache
styleSheet FwStyleSheet
mainWindowDelegateCallbacks IMainWindowDelegateCallbacks
mediator Mediator
sLayoutPropertyName string
return void

XmlDocConfigureDlg() public method

public XmlDocConfigureDlg ( ) : System
return System