C# Класс SIL.FieldWorks.XWorks.DTMenuHandler

DTMenuHandler provides context menus to the data tree. When the user (or test code) selects issues commands, this class also invokes the corresponding methods on the data tree. You may create subclasses to do smart things with menus.
Although XWorks doesn't sound Flex-specific, most of the menu commands handled in this file are specific to Flex.
Наследование: IxCoreColleague
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
m_configuration System.Xml.XmlNode
m_dataEntryForm SIL.FieldWorks.Common.Framework.DetailControls.DataTree
m_mediator XCore.Mediator

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

Метод Описание
Create ( DataTree dataEntryForm, XmlNode configuration ) : DTMenuHandler

factory method which creates the correct subclass based on the XML parameters

Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
OnConvertEntryIntoComplexForm ( object argument ) : bool

OnConvertEntryIntoVariant ( object argument ) : bool

OnDataTreeCopy ( object cmd ) : bool

This method is called when a user selects a Copy operation in on a slice.

OnDataTreeDelete ( object cmd ) : bool

This method is called when a user selects a Delete operation for a slice. The menu item is defined in DataTreeInclude.xml with message="DataTreeDelete"

OnDataTreeHelp ( object cmd ) : bool
OnDataTreeInsert ( object cmd ) : bool

This method is called when a user selects an Insert operation in on a slice.

OnDeleteMediaFile ( object cmd ) : bool
OnDisplayConvertEntryIntoComplexForm ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Allow only one complex form type LexEntryRef object per LexEntry.

OnDisplayConvertEntryIntoVariant ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Allow any number of variant type LexEntryRef objects per LexEntry.

OnDisplayDataTreeCopy ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

decide whether to display this tree copy Menu Item

OnDisplayDataTreeHelp ( object cmd, XCore.UIItemDisplayProperties display ) : bool
OnDisplayDataTreeInsert ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

decide whether to display this tree insert Menu Item

OnDisplayDeleteMediaFile ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Check whether or not to display the "Delete This Media Link" command.

OnDisplayInsertMediaFile ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Check whether or not to display the "Insert Sound or Movie" command.

OnDisplayInsertPicture ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Determine whether we can insert a picture here.

OnInsertMediaFile ( object cmd ) : bool

Called by reflection based on menu item InsertSoundFile.

OnInsertPicture ( object cmd ) : bool

Called by reflection based on menu item InsertPicture.

OnLaunchGuiControl ( object commandObject ) : bool

Launch a control dynamically from the control pointed to by the 'guicontrol' id in the command object.

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

Метод Описание
CanInsert ( Command command, Slice currentSlice, int &index ) : bool

Check to see if the insertion command makes sense for the current slice and its ContainingDataTree.

CanInsertFieldIntoObj ( SIL.FieldWorks.FDO.FdoCache fdoCache, string fieldName, ICmObject parentObj, int &index ) : bool

Check if the field can be inserted into the given object.

DTMenuHandler ( ) : System
ExtractInsertCommandInfo ( Command command, string &fieldName, string &className ) : void

Get the class name and field for the given insertion command.

MakeSliceContextMenu ( Slice slice, bool fHotLinkOnly ) : ContextMenu

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

Метод Описание
AddNewLexEntryRef ( object argument, int flidTypes ) : bool
CanInsertPictureOrMediaFile ( object cmd, int &flid ) : bool
ComponentShowsComplexForm ( ICmObject component, ILexEntry cplxForm, ILexEntryRef &cfRef ) : bool

Does this component show this complex form in the dictionary? The component can be a ILexEntry or a ILexSense. The reference to the complex form from the component is outted.

DeleteObject ( Command command ) : bool
DisplayConvertLexEntry ( object commandObject ) : bool
ExtractInsertCommandParameters ( Command command ) : XmlNode
GetFlidIfPossible ( int clid, string fieldName, IFwMetaDataCacheManaged mdc ) : int

This seems a bit clumsy, but the metadata cache now throws an exception if the class id/field name pair isn't valid for GetFieldId2(). So we check first in cases where we want a zero if not found.

GetMessageTargets ( ) : IxCoreColleague[]
GetSelectedComplexFormHvo ( Slice complexFormsSlice ) : int

Intended to get a selected complex form, but it can probably get other selections from entries or senses.

GetSelectedComponentHvo ( ) : int
GetSelectionHvoFromControls ( Slice slice ) : int

Gets the selection HVO from a slice control.

InsertMediaFile ( object cmd, string filter, string keyCaption, string defaultCaption ) : bool
OnAddComponentToPrimary ( object argument ) : bool
OnDataTreeAddReference ( object cmd ) : bool
OnDataTreeDeleteReference ( object cmd ) : bool
OnDataTreeEdit ( object cmd ) : bool
OnDataTreeMerge ( object cmd ) : bool
OnDataTreeSplit ( object cmd ) : bool
OnDisplayAddComponentToPrimary ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayDataTreeDelete ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayDataTreeDeleteReference ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayDataTreeEdit ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayDataTreeMerge ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayDataTreeSplit ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayMoveDownObjectInSequence ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayMoveUpObjectInSequence ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnDisplayVisibleComplexForm ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnMoveDownObjectInSequence ( object cmd ) : bool
OnMoveUpObjectInSequence ( object cmd ) : bool
OnVisibleComplexForm ( object argument ) : bool
ShowContextMenu2Id ( XmlNode caller, bool fHotLinkOnly ) : string
ShowSliceContextMenu ( object sender, SliceMenuRequestArgs e ) : ContextMenu
SliceConfiguredForField ( XmlNode node, string field ) : bool

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

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

Check to see if the insertion command makes sense for the current slice and its ContainingDataTree.
protected CanInsert ( Command command, Slice currentSlice, int &index ) : bool
command Command insertion command
currentSlice Slice current selected slice on the ContainingDataTree
index int 0-based position for insert, if known, or -1
Результат bool

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

Check if the field can be inserted into the given object.
protected CanInsertFieldIntoObj ( SIL.FieldWorks.FDO.FdoCache fdoCache, string fieldName, ICmObject parentObj, int &index ) : bool
fdoCache SIL.FieldWorks.FDO.FdoCache
fieldName string name of the field to be inserted
parentObj ICmObject The object where the item would be inserted, if possible.
index int index (0-based) where it will be inserted. -1 if atomic or returns false
Результат bool

Create() публичный статический Метод

factory method which creates the correct subclass based on the XML parameters
public static Create ( DataTree dataEntryForm, XmlNode configuration ) : DTMenuHandler
dataEntryForm SIL.FieldWorks.Common.Framework.DetailControls.DataTree
configuration System.Xml.XmlNode
Результат DTMenuHandler

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

protected DTMenuHandler ( ) : System
Результат System

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

Get the class name and field for the given insertion command.
static protected ExtractInsertCommandInfo ( Command command, string &fieldName, string &className ) : void
command Command insertion command
fieldName string
className string
Результат void

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

public Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System.Xml.XmlNode
Результат void

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

protected MakeSliceContextMenu ( Slice slice, bool fHotLinkOnly ) : ContextMenu
slice Slice
fHotLinkOnly bool
Результат System.Windows.Forms.ContextMenu

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

public OnConvertEntryIntoComplexForm ( object argument ) : bool
argument object
Результат bool

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

public OnConvertEntryIntoVariant ( object argument ) : bool
argument object
Результат bool

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

This method is called when a user selects a Copy operation in on a slice.
public OnDataTreeCopy ( object cmd ) : bool
cmd object
Результат bool

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

This method is called when a user selects a Delete operation for a slice. The menu item is defined in DataTreeInclude.xml with message="DataTreeDelete"
public OnDataTreeDelete ( object cmd ) : bool
cmd object
Результат bool

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

public OnDataTreeHelp ( object cmd ) : bool
cmd object
Результат bool

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

This method is called when a user selects an Insert operation in on a slice.
public OnDataTreeInsert ( object cmd ) : bool
cmd object
Результат bool

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

public OnDeleteMediaFile ( object cmd ) : bool
cmd object
Результат bool

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

Allow only one complex form type LexEntryRef object per LexEntry.
public OnDisplayConvertEntryIntoComplexForm ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

Allow any number of variant type LexEntryRef objects per LexEntry.
public OnDisplayConvertEntryIntoVariant ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

decide whether to display this tree copy Menu Item
public OnDisplayDataTreeCopy ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

public OnDisplayDataTreeHelp ( object cmd, XCore.UIItemDisplayProperties display ) : bool
cmd object
display XCore.UIItemDisplayProperties
Результат bool

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

decide whether to display this tree insert Menu Item
public OnDisplayDataTreeInsert ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

Check whether or not to display the "Delete This Media Link" command.
public OnDisplayDeleteMediaFile ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

Check whether or not to display the "Insert Sound or Movie" command.
public OnDisplayInsertMediaFile ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

Determine whether we can insert a picture here.
public OnDisplayInsertPicture ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
Результат bool

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

Called by reflection based on menu item InsertSoundFile.
public OnInsertMediaFile ( object cmd ) : bool
cmd object
Результат bool

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

Called by reflection based on menu item InsertPicture.
public OnInsertPicture ( object cmd ) : bool
cmd object
Результат bool

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

Launch a control dynamically from the control pointed to by the 'guicontrol' id in the command object.
public OnLaunchGuiControl ( object commandObject ) : bool
commandObject object
Результат bool

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

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

COnfiguration information.
protected XmlNode,System.Xml m_configuration
Результат System.Xml.XmlNode

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

Tree form.
protected DataTree,SIL.FieldWorks.Common.Framework.DetailControls m_dataEntryForm
Результат SIL.FieldWorks.Common.Framework.DetailControls.DataTree

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

Mediator that passes off messages.
protected Mediator,XCore m_mediator
Результат XCore.Mediator