C# Класс SIL.FieldWorks.LexText.Controls.PopupTreeManager

Handles a TreeCombo control (Widgets assembly). Subclass must at least implement MakeMenuItems.
Наследование: IFWDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
m_isDisposed bool
m_kEmptyNode HvoTreeNode
m_mediator XCore.Mediator
m_selPrior System.Windows.Forms.TreeNode

Private Properties

Свойство Тип Описание
Init void
m_treeCombo_BeforeSelect void
popupTree_PopupTreeClosed void

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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...'.

Приватные методы

Метод Описание
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

Описание методов

AddMoreItem() защищенный Метод

Add a 'More...' item to the tree. Subclass is responsible to implement.
protected AddMoreItem ( PopupTree popupTree ) : void
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Результат void

AddNodes() защищенный Метод

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
Результат System.Windows.Forms.TreeNode

AddNodes() защищенный Метод

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
Результат System.Windows.Forms.TreeNode

AddNotSureItem() защищенный Метод

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
Результат System.Windows.Forms.TreeNode

AddPossibilityListItems() защищенный Метод

protected AddPossibilityListItems ( PopupTree popupTree, int hvoTarget ) : TreeNode
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
hvoTarget int
Результат System.Windows.Forms.TreeNode

AddTimberLine() защищенный Метод

Add the --- line to the popup (use if adding any 'extra' items).
protected AddTimberLine ( PopupTree popupTree ) : void
popupTree SIL.FieldWorks.Common.Widgets.PopupTree
Результат void

AppendAdditionalItems() защищенный Метод

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
Результат System.Windows.Forms.TreeNode

CheckDisposed() публичный Метод

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
Результат void

Dispose() публичный Метод

Must not be virtual.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

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
Результат void

GetPopupTree() защищенный Метод

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
Результат SIL.FieldWorks.Common.Widgets.PopupTree

GetTssLabel() защищенный статический Метод

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
Результат ITsString

LoadPopupTree() публичный Метод

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
Результат void

MakeMenuItems() защищенный абстрактный Метод

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
Результат System.Windows.Forms.TreeNode

PopupTreeManager() публичный Метод

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
Результат System

PopupTreeManager() публичный Метод

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
Результат System

SelectChosenItem() защищенный Метод

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
Результат void

SetComboTextToLastConfirmedSelection() защищенный Метод

Make sure the combo text has correct value
protected SetComboTextToLastConfirmedSelection ( ) : void
Результат void

SetEmptyLabel() публичный Метод

Set the label on the empty node.
public SetEmptyLabel ( string label ) : void
label string
Результат void

m_treeCombo_AfterSelect() защищенный Метод

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
Результат void

Описание свойств

m_isDisposed защищенное свойство

True, if the object has been disposed.
protected bool m_isDisposed
Результат bool

m_kEmptyNode защищенное свойство

"" node, or sometimes 'Any' node.
protected HvoTreeNode m_kEmptyNode
Результат HvoTreeNode

m_mediator защищенное свойство

protected Mediator,XCore m_mediator
Результат XCore.Mediator

m_selPrior защищенное свойство

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
Результат System.Windows.Forms.TreeNode