C# Class SIL.FieldWorks.Common.Framework.DetailControls.SemanticDomainSelectionUtility

This class contains methods that can be used for displaying the Semantic Domains in a TreeView and ListView. These views are used in FLEX for allowing the user to select Semantic Domains.
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes publiques

Méthode Description
AdjustSelectedDomainList ( ICmObject domain, IVwStylesheet stylesheet, bool check, ListView selectedDomainsList ) : void

Find the item in the selectedDomainsList if it is there and set the checkmark accordingly, or add it and check it.

AdjustTreeAndListView ( object tag, bool check, TreeView domainTree, ListView domainList ) : void

Adjust the checkbox for the nodes in the TreeView and ListView according to the 'tag' and 'check' parameter values.

CreateLabelListItem ( ICmObject semDom, IVwStylesheet stylesheet, bool createChecked, bool displayUsage ) : System.Windows.Forms.ListViewItem

Creates a ListViewItem for the given ICmObject

SenseReferenceCount ( ICmSemanticDomain domain ) : int

Don't count references to Semantic Domains from other Semantic Domains. The user only cares about how many times in the lexicon the Semantic Domain is used.

UpdateDomainListLabels ( IEnumerable createObjectLabels, IVwStylesheet stylesheet, ListView domainList, bool displayUsage ) : void

Clear the ListView and add createObjectLabels to it. 'displayUsage' determines if the items are checked/unchecked.

UpdateDomainTreeLabels ( IEnumerable labels, bool displayUsage, TreeView domainTree, IVwStylesheet stylesheet, HashSet selectedItems ) : void

Populate the TreeView with the labels and check/uncheck according to the selectedItems and displayUsage parameters.

Private Methods

Méthode Description
CreateLabelNode ( ObjectLabel label, IVwStylesheet stylesheet, IEnumerable selectedItems, bool displayUsage ) : DomainNode

Creates the label node.

GetFontForFormFromObjectLabels ( IEnumerable labelList, IVwStylesheet stylesheet ) : Font
RecursivelyAdjustTreeNode ( DomainNode node, object tag, bool check ) : bool

Check/Uncheck the TreeView node and recursively do this to any children nodes if the node matches the 'tag' object.

Method Details

AdjustSelectedDomainList() public static méthode

Find the item in the selectedDomainsList if it is there and set the checkmark accordingly, or add it and check it.
public static AdjustSelectedDomainList ( ICmObject domain, IVwStylesheet stylesheet, bool check, ListView selectedDomainsList ) : void
domain ICmObject
stylesheet IVwStylesheet
check bool
selectedDomainsList System.Windows.Forms.ListView
Résultat void

AdjustTreeAndListView() public static méthode

Adjust the checkbox for the nodes in the TreeView and ListView according to the 'tag' and 'check' parameter values.
public static AdjustTreeAndListView ( object tag, bool check, TreeView domainTree, ListView domainList ) : void
tag object
check bool
domainTree System.Windows.Forms.TreeView
domainList System.Windows.Forms.ListView
Résultat void

CreateLabelListItem() public static méthode

Creates a ListViewItem for the given ICmObject
public static CreateLabelListItem ( ICmObject semDom, IVwStylesheet stylesheet, bool createChecked, bool displayUsage ) : System.Windows.Forms.ListViewItem
semDom ICmObject A Semantic Domain
stylesheet IVwStylesheet
createChecked bool
displayUsage bool
Résultat System.Windows.Forms.ListViewItem

SenseReferenceCount() public static méthode

Don't count references to Semantic Domains from other Semantic Domains. The user only cares about how many times in the lexicon the Semantic Domain is used.
public static SenseReferenceCount ( ICmSemanticDomain domain ) : int
domain ICmSemanticDomain
Résultat int

UpdateDomainListLabels() public static méthode

Clear the ListView and add createObjectLabels to it. 'displayUsage' determines if the items are checked/unchecked.
public static UpdateDomainListLabels ( IEnumerable createObjectLabels, IVwStylesheet stylesheet, ListView domainList, bool displayUsage ) : void
createObjectLabels IEnumerable
stylesheet IVwStylesheet
domainList System.Windows.Forms.ListView
displayUsage bool
Résultat void

UpdateDomainTreeLabels() public static méthode

Populate the TreeView with the labels and check/uncheck according to the selectedItems and displayUsage parameters.
public static UpdateDomainTreeLabels ( IEnumerable labels, bool displayUsage, TreeView domainTree, IVwStylesheet stylesheet, HashSet selectedItems ) : void
labels IEnumerable
displayUsage bool
domainTree System.Windows.Forms.TreeView
stylesheet IVwStylesheet
selectedItems HashSet
Résultat void