C# Class SIL.FieldWorks.LexText.Controls.PopupTreeManager

Handles a TreeCombo control (Widgets assembly). Subclass must at least implement MakeMenuItems.
Inheritance: IFWDisposable
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Свойство Type Description
m_isDisposed bool
m_kEmptyNode HvoTreeNode
m_mediator XCore.Mediator
m_selPrior System.Windows.Forms.TreeNode

Private Properties

Свойство Type Description
Init void
m_treeCombo_BeforeSelect void
popupTree_PopupTreeClosed void

Méthodes publiques

Méthode Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

Dispose ( ) : void

Must not be virtual.

LoadPopupTree ( int hvoSpecifiedTarget ) : void

Load the PopupTree with HvoTreeNode objects, which represent all POSes in the list. Reloads the PopupTree even if it has been loaded before, since the list may now have new ones in it.

PopupTreeManager ( PopupTree popupTree, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent ) : System

Constructor.

PopupTreeManager ( TreeCombo treeCombo, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent ) : System

Constructor.

SetEmptyLabel ( string label ) : void

Set the label on the empty node.

Méthodes protégées

Méthode Description
AddMoreItem ( PopupTree popupTree ) : void

Add a 'More...' item to the tree. Subclass is responsible to implement.

AddNodes ( TreeNodeCollection nodes, int hvoOwner, int flid, int hvoTarget, int tagName ) : TreeNode

Add to the nodes parameter an HvoTreeNode for each hvo in property flid of object hvo. Give it to children (by calling recursively) for each of its subpossibilities.

AddNodes ( TreeNodeCollection nodes, int hvoOwner, int flid, int flidSub, int hvoTarget, int tagName ) : TreeNode

AddNotSureItem ( PopupTree popupTree ) : TreeNode

Add a 'not sure' item to the menu. If the current target is zero, it will be selected. It is saved as m_kEmptyNode. Also returns the new node.

AddPossibilityListItems ( PopupTree popupTree, int hvoTarget ) : TreeNode

AddTimberLine ( PopupTree popupTree ) : void

Add the --- line to the popup (use if adding any 'extra' items).

AppendAdditionalItems ( PopupTree popupTree, int hvoTarget ) : TreeNode

override to add additional nodes to popupTree (e.g. AddNotSureItem, AddTimberline)

Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

GetPopupTree ( ) : PopupTree

Get the popup tree we are managing. This may be a stand-alone popup tree, or one that is part of the implementation of a tree combo box.

GetTssLabel ( SIL.FieldWorks.FDO.FdoCache cache, int hvoItem, int flidName, int wsName ) : ITsString
MakeMenuItems ( PopupTree popupTree, int hvoTarget ) : TreeNode

Make all the menu items. May well call things like AddTimberline, AddNotSureItem, AddMoreItem.

SelectChosenItem ( TreeNode item, PopupTree popupTree ) : void

Select the specified menu item in the tree.

SetComboTextToLastConfirmedSelection ( ) : void

Make sure the combo text has correct value

m_treeCombo_AfterSelect ( object sender, TreeViewEventArgs e ) : void

Override this to handle any special items like 'More...'.

Private Methods

Méthode Description
Init ( SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent ) : void
m_treeCombo_BeforeSelect ( object sender, System.Windows.Forms.TreeViewCancelEventArgs e ) : void
popupTree_PopupTreeClosed ( object sender, TreeViewEventArgs e ) : void

Method Details

AddMoreItem() protected méthode

Add a 'More...' item to the tree. Subclass is responsible to implement.
protected AddMoreItem ( PopupTree popupTree ) : void
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Résultat void

AddNodes() protected méthode

Add to the nodes parameter an HvoTreeNode for each hvo in property flid of object hvo. Give it to children (by calling recursively) for each of its subpossibilities.
protected AddNodes ( TreeNodeCollection nodes, int hvoOwner, int flid, int hvoTarget, int tagName ) : TreeNode
nodes System.Windows.Forms.TreeNodeCollection
hvoOwner int
flid int
hvoTarget int
tagName int
Résultat System.Windows.Forms.TreeNode

AddNodes() protected méthode

protected AddNodes ( TreeNodeCollection nodes, int hvoOwner, int flid, int flidSub, int hvoTarget, int tagName ) : TreeNode
nodes System.Windows.Forms.TreeNodeCollection
hvoOwner int
flid int
flidSub int specify a subitems, /// other than CmPossibilityTags.kflidSubPossibilities
hvoTarget int
tagName int
Résultat System.Windows.Forms.TreeNode

AddNotSureItem() protected méthode

Add a 'not sure' item to the menu. If the current target is zero, it will be selected. It is saved as m_kEmptyNode. Also returns the new node.
protected AddNotSureItem ( PopupTree popupTree ) : TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Résultat System.Windows.Forms.TreeNode

AddPossibilityListItems() protected méthode

protected AddPossibilityListItems ( PopupTree popupTree, int hvoTarget ) : TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
hvoTarget int
Résultat System.Windows.Forms.TreeNode

AddTimberLine() protected méthode

Add the --- line to the popup (use if adding any 'extra' items).
protected AddTimberLine ( PopupTree popupTree ) : void
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Résultat void

AppendAdditionalItems() protected méthode

override to add additional nodes to popupTree (e.g. AddNotSureItem, AddTimberline)
protected AppendAdditionalItems ( PopupTree popupTree, int hvoTarget ) : TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
hvoTarget int
Résultat System.Windows.Forms.TreeNode

CheckDisposed() public méthode

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
Résultat void

Dispose() public méthode

Must not be virtual.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

GetPopupTree() protected méthode

Get the popup tree we are managing. This may be a stand-alone popup tree, or one that is part of the implementation of a tree combo box.
protected GetPopupTree ( ) : PopupTree
Résultat SIL.FieldWorks.Common.Widgets.PopupTree

GetTssLabel() protected static méthode

protected static GetTssLabel ( SIL.FieldWorks.FDO.FdoCache cache, int hvoItem, int flidName, int wsName ) : ITsString
cache SIL.FieldWorks.FDO.FdoCache
hvoItem int
flidName int
wsName int
Résultat ITsString

LoadPopupTree() public méthode

Load the PopupTree with HvoTreeNode objects, which represent all POSes in the list. Reloads the PopupTree even if it has been loaded before, since the list may now have new ones in it.
public LoadPopupTree ( int hvoSpecifiedTarget ) : void
hvoSpecifiedTarget int
Résultat void

MakeMenuItems() protected abstract méthode

Make all the menu items. May well call things like AddTimberline, AddNotSureItem, AddMoreItem.
protected abstract MakeMenuItems ( PopupTree popupTree, int hvoTarget ) : TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
hvoTarget int
Résultat System.Windows.Forms.TreeNode

PopupTreeManager() public méthode

Constructor.
public PopupTreeManager ( PopupTree popupTree, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent ) : System
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
cache SIL.FieldWorks.FDO.FdoCache
mediator XCore.Mediator
list ICmPossibilityList
ws int
useAbbr bool
parent System.Windows.Forms.Form
Résultat System

PopupTreeManager() public méthode

Constructor.
public PopupTreeManager ( TreeCombo treeCombo, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent ) : System
treeCombo SIL.FieldWorks.Common.Widgets.TreeCombo
cache SIL.FieldWorks.FDO.FdoCache
mediator XCore.Mediator
list ICmPossibilityList
ws int
useAbbr bool
parent System.Windows.Forms.Form
Résultat System

SelectChosenItem() protected méthode

Select the specified menu item in the tree.
protected SelectChosenItem ( TreeNode item, PopupTree popupTree ) : void
item System.Windows.Forms.TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Résultat void

SetComboTextToLastConfirmedSelection() protected méthode

Make sure the combo text has correct value
protected SetComboTextToLastConfirmedSelection ( ) : void
Résultat void

SetEmptyLabel() public méthode

Set the label on the empty node.
public SetEmptyLabel ( string label ) : void
label string
Résultat void

m_treeCombo_AfterSelect() protected méthode

Override this to handle any special items like 'More...'.
protected m_treeCombo_AfterSelect ( object sender, TreeViewEventArgs e ) : void
sender object
e System.Windows.Forms.TreeViewEventArgs
Résultat void

Property Details

m_isDisposed protected_oe property

True, if the object has been disposed.
protected bool m_isDisposed
Résultat bool

m_kEmptyNode protected_oe property

"" node, or sometimes 'Any' node.
protected HvoTreeNode m_kEmptyNode
Résultat HvoTreeNode

m_mediator protected_oe property

protected Mediator,XCore m_mediator
Résultat XCore.Mediator

m_selPrior protected_oe property

Sometimes we need to revert to the previous selection, so save it just in case. (See FWR-3082.)
protected TreeNode,System.Windows.Forms m_selPrior
Résultat System.Windows.Forms.TreeNode