C# Class SIL.FieldWorks.XWorks.MorphologyEditor.RuleFormulaControl

This class class represents a rule formula control. It is not intended to be used directly. Specific phonological/morphological rules should extend this class. It is not abstract so that it can be modified in Windows Form designer. It is a button launcher with a rule formula view and a rule insertion control. It handles selection, deletion, insertion, and cursor movement for a rule formula. Rules that extend this class override the methods that provide information about the various table cells in the rule and the data contained in each cell.
Inheritance: SIL.FieldWorks.Common.Framework.DetailControls.ButtonLauncher
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_insertionControl SIL.FieldWorks.LexText.Controls.InsertionControl
m_view SIL.FieldWorks.LexText.Controls.PatternView

Public Methods

Method Description
GetContext ( SelectionHelper sel ) : object
GetContext ( SelectionHelper sel, SelectionHelper limit ) : object
GetContextCount ( object ctxt ) : int
GetFlid ( object ctxt ) : int
GetItem ( SelectionHelper sel, SelectionHelper limit ) : object
GetItemContextIndex ( object ctxt, object obj ) : int
GetLevelInfo ( object ctxt, int index ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]
GetNextContext ( object ctxt ) : object
GetPrevContext ( object ctxt ) : object
Initialize ( SIL.FieldWorks.FDO.FdoCache cache, ICmObject obj, int flid, string fieldName, IPersistenceProvider persistProvider, XCore.Mediator mediator, string displayNameProperty, string displayWs ) : void
RuleFormulaControl ( ) : System
RuleFormulaControl ( XmlNode configurationNode ) : System
SetContextFeatures ( ) : void

Sets the phonological features for the currently selected natural class simple context with a feature-based natural class.

Protected Methods

Method Description
DisplayChooser ( string fieldName, string linkText, string toolName, string guiControl, IEnumerable candidates ) : ICmObject
GetCell ( SelectionHelper sel ) : int
GetCell ( SelectionHelper sel, SelectionHelper limit ) : int
GetCellCount ( int cellId ) : int
GetCmObject ( SelectionHelper sel, SelectionHelper limit ) : ICmObject
GetFlid ( int cellId ) : int
GetIndexToRemove ( ICmObject objs, SelectionHelper sel, bool forward ) : int
GetIndicesToRemove ( ICmObject objs, SelectionHelper sel ) : int[]
GetInsertionIndex ( ICmObject objs, SelectionHelper sel ) : int
GetItemCellIndex ( int cellId, ICmObject obj ) : int
GetLevelInfo ( int cellId, int index ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]
GetNextCell ( int cellId ) : int
GetPrevCell ( int cellId ) : int
HandleChooser ( ) : void

Handle launching of the environment chooser.

Subclasses should override this method, if the SimpleListChooser is not suitable.

InsertBdry ( IPhBdryMarker bdry, SelectionHelper sel, int &cellIndex ) : int

Inserts an item from a boundary.

InsertColumn ( SelectionHelper sel ) : int

Inserts a new column.

InsertContextInto ( IPhSimpleContext ctxt, SelectionHelper sel, IFdoOwningSequence seq ) : int
InsertContextInto ( IPhSimpleContext ctxt, SelectionHelper sel, IPhSequenceContext seqCtxt ) : int
InsertIndex ( int index, SelectionHelper sel, int &cellIndex ) : int

Inserts an item from the specified rule mapping index.

InsertNC ( IPhNaturalClass nc, SelectionHelper sel, int &cellIndex, IPhSimpleContextNC &ctxt ) : int

Inserts an item from a natural class.

InsertPhoneme ( IPhPhoneme phoneme, SelectionHelper sel, int &cellIndex ) : int

Inserts an item from a phoneme.

InsertVariable ( SelectionHelper sel, int &cellIndex ) : int

Inserts the variable (PhVariable).

ReconstructView ( int cellId, int cellIndex, bool initial ) : void

Reconstructs the view and moves the cursor the specified position.

RemoveContextsFrom ( bool forward, SelectionHelper sel, IFdoOwningSequence seq, bool preRemovalSideEffects, int &index ) : bool
RemoveContextsFrom ( bool forward, SelectionHelper sel, IPhSequenceContext seqCtxt, bool preRemovalSideEffects, int &index ) : bool
RemoveItems ( SelectionHelper sel, bool forward, int &cellIndex ) : int

Removes items based on the specified selection and direction.

SetupPhonologicalFeatureChoooserDlg ( PhonologicalFeatureChooserDlg featChooser ) : void
UpdateEnvironment ( IPhEnvironment env ) : int

Updates the environment.

Private Methods

Method Description
ContextMenuRequested ( object sender, ContextMenuRequestedEventArgs e ) : void
GetOptionString ( RuleInsertType type ) : string
InitializeComponent ( ) : void
InsertNC ( IPhNaturalClass nc, SelectionHelper sel, int &cellIndex ) : int
IsMorphBoundary ( IPhContextOrVar ctxt ) : bool
IsWordBoundary ( IPhContextOrVar ctxt ) : bool
ProcessIndicesSeqContext ( ICmObject ctxts, bool preRemovalSideEffects, int idx ) : void
ProcessIndicesSimpleContext ( IFdoOwningSequence seq, ICmObject ctxts, bool preRemovalSideEffects, int idx ) : void
RemoveItemsRequested ( object sender, RemoveItemsRequestedEventArgs e ) : void
SelectionChanged ( object sender, EventArgs eventArgs ) : void
ToCellId ( object ctxt ) : int
ToContextObject ( int cellId ) : object
m_insertionControl_Insert ( object sender, InsertEventArgs e ) : void

Handles the Insert event of the m_insertionControl control.

Method Details

DisplayChooser() protected method

protected DisplayChooser ( string fieldName, string linkText, string toolName, string guiControl, IEnumerable candidates ) : ICmObject
fieldName string
linkText string
toolName string
guiControl string
candidates IEnumerable
return ICmObject

GetCell() protected method

protected GetCell ( SelectionHelper sel ) : int
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
return int

GetCell() protected method

protected GetCell ( SelectionHelper sel, SelectionHelper limit ) : int
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
limit SIL.FieldWorks.Common.RootSites.SelectionHelper
return int

GetCellCount() protected method

protected GetCellCount ( int cellId ) : int
cellId int
return int

GetCmObject() protected method

protected GetCmObject ( SelectionHelper sel, SelectionHelper limit ) : ICmObject
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
limit SIL.FieldWorks.Common.RootSites.SelectionHelper
return ICmObject

GetContext() public method

public GetContext ( SelectionHelper sel ) : object
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
return object

GetContext() public method

public GetContext ( SelectionHelper sel, SelectionHelper limit ) : object
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
limit SIL.FieldWorks.Common.RootSites.SelectionHelper
return object

GetContextCount() public method

public GetContextCount ( object ctxt ) : int
ctxt object
return int

GetFlid() protected method

protected GetFlid ( int cellId ) : int
cellId int
return int

GetFlid() public method

public GetFlid ( object ctxt ) : int
ctxt object
return int

GetIndexToRemove() protected method

protected GetIndexToRemove ( ICmObject objs, SelectionHelper sel, bool forward ) : int
objs ICmObject
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
forward bool
return int

GetIndicesToRemove() protected method

protected GetIndicesToRemove ( ICmObject objs, SelectionHelper sel ) : int[]
objs ICmObject
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
return int[]

GetInsertionIndex() protected method

protected GetInsertionIndex ( ICmObject objs, SelectionHelper sel ) : int
objs ICmObject
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
return int

GetItem() public method

public GetItem ( SelectionHelper sel, SelectionHelper limit ) : object
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
limit SIL.FieldWorks.Common.RootSites.SelectionHelper
return object

GetItemCellIndex() protected method

protected GetItemCellIndex ( int cellId, ICmObject obj ) : int
cellId int
obj ICmObject
return int

GetItemContextIndex() public method

public GetItemContextIndex ( object ctxt, object obj ) : int
ctxt object
obj object
return int

GetLevelInfo() protected method

protected GetLevelInfo ( int cellId, int index ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]
cellId int
index int
return SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]

GetLevelInfo() public method

public GetLevelInfo ( object ctxt, int index ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]
ctxt object
index int
return SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]

GetNextCell() protected method

protected GetNextCell ( int cellId ) : int
cellId int
return int

GetNextContext() public method

public GetNextContext ( object ctxt ) : object
ctxt object
return object

GetPrevCell() protected method

protected GetPrevCell ( int cellId ) : int
cellId int
return int

GetPrevContext() public method

public GetPrevContext ( object ctxt ) : object
ctxt object
return object

HandleChooser() protected method

Handle launching of the environment chooser.
Subclasses should override this method, if the SimpleListChooser is not suitable.
protected HandleChooser ( ) : void
return void

Initialize() public method

public Initialize ( SIL.FieldWorks.FDO.FdoCache cache, ICmObject obj, int flid, string fieldName, IPersistenceProvider persistProvider, XCore.Mediator mediator, string displayNameProperty, string displayWs ) : void
cache SIL.FieldWorks.FDO.FdoCache
obj ICmObject
flid int
fieldName string
persistProvider IPersistenceProvider
mediator XCore.Mediator
displayNameProperty string
displayWs string
return void

InsertBdry() protected method

Inserts an item from a boundary.
protected InsertBdry ( IPhBdryMarker bdry, SelectionHelper sel, int &cellIndex ) : int
bdry IPhBdryMarker The boundary.
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The sel.
cellIndex int Index of the new item.
return int

InsertColumn() protected method

Inserts a new column.
protected InsertColumn ( SelectionHelper sel ) : int
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
return int

InsertContextInto() protected method

protected InsertContextInto ( IPhSimpleContext ctxt, SelectionHelper sel, IFdoOwningSequence seq ) : int
ctxt IPhSimpleContext
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
seq IFdoOwningSequence
return int

InsertContextInto() protected method

protected InsertContextInto ( IPhSimpleContext ctxt, SelectionHelper sel, IPhSequenceContext seqCtxt ) : int
ctxt IPhSimpleContext
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
seqCtxt IPhSequenceContext
return int

InsertIndex() protected method

Inserts an item from the specified rule mapping index.
protected InsertIndex ( int index, SelectionHelper sel, int &cellIndex ) : int
index int The rule mapping index.
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
cellIndex int Index of the new item.
return int

InsertNC() protected method

Inserts an item from a natural class.
protected InsertNC ( IPhNaturalClass nc, SelectionHelper sel, int &cellIndex, IPhSimpleContextNC &ctxt ) : int
nc IPhNaturalClass The natural class.
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
cellIndex int Index of the new item.
ctxt IPhSimpleContextNC The new context.
return int

InsertPhoneme() protected method

Inserts an item from a phoneme.
protected InsertPhoneme ( IPhPhoneme phoneme, SelectionHelper sel, int &cellIndex ) : int
phoneme IPhPhoneme The phoneme.
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
cellIndex int Index of the new item.
return int

InsertVariable() protected method

Inserts the variable (PhVariable).
protected InsertVariable ( SelectionHelper sel, int &cellIndex ) : int
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
cellIndex int Index of the new item.
return int

ReconstructView() protected method

Reconstructs the view and moves the cursor the specified position.
protected ReconstructView ( int cellId, int cellIndex, bool initial ) : void
cellId int The cell id.
cellIndex int Index of the item in the cell.
initial bool if true move the cursor to the beginning of the specified item, otherwise it is moved to the end
return void

RemoveContextsFrom() protected method

protected RemoveContextsFrom ( bool forward, SelectionHelper sel, IFdoOwningSequence seq, bool preRemovalSideEffects, int &index ) : bool
forward bool
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
seq IFdoOwningSequence
preRemovalSideEffects bool
index int
return bool

RemoveContextsFrom() protected method

protected RemoveContextsFrom ( bool forward, SelectionHelper sel, IPhSequenceContext seqCtxt, bool preRemovalSideEffects, int &index ) : bool
forward bool
sel SIL.FieldWorks.Common.RootSites.SelectionHelper
seqCtxt IPhSequenceContext
preRemovalSideEffects bool
index int
return bool

RemoveItems() protected method

Removes items based on the specified selection and direction.
protected RemoveItems ( SelectionHelper sel, bool forward, int &cellIndex ) : int
sel SIL.FieldWorks.Common.RootSites.SelectionHelper The selection.
forward bool if true delete button was used, otherwise backspace was used
cellIndex int Index of the item before the removed items.
return int

RuleFormulaControl() public method

public RuleFormulaControl ( ) : System
return System

RuleFormulaControl() public method

public RuleFormulaControl ( XmlNode configurationNode ) : System
configurationNode System.Xml.XmlNode
return System

SetContextFeatures() public method

Sets the phonological features for the currently selected natural class simple context with a feature-based natural class.
public SetContextFeatures ( ) : void
return void

SetupPhonologicalFeatureChoooserDlg() protected method

protected SetupPhonologicalFeatureChoooserDlg ( PhonologicalFeatureChooserDlg featChooser ) : void
featChooser PhonologicalFeatureChooserDlg
return void

UpdateEnvironment() protected method

Updates the environment.
protected UpdateEnvironment ( IPhEnvironment env ) : int
env IPhEnvironment The environment.
return int

Property Details

m_insertionControl protected property

protected InsertionControl,SIL.FieldWorks.LexText.Controls m_insertionControl
return SIL.FieldWorks.LexText.Controls.InsertionControl

m_view protected property

protected PatternView,SIL.FieldWorks.LexText.Controls m_view
return SIL.FieldWorks.LexText.Controls.PatternView