C# Class SIL.FieldWorks.XWorks.LexEd.FLExBridgeListener

Inheritance: IxCoreColleague, IFWDisposable
Datei anzeigen Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
BroadcastMasterRefresh void
CheckForExistingFileName bool
CheckForFlexBridgeInstalledAndSetMenuItemProperties void
ConvertFlexNotesToLift void
ConvertLiftNotesToFlex void
ConvertRefAttrs void
DetectLiftConflicts bool
DetectMainConflicts bool
Dispose void
DoMercilessLiftImport bool
DoSendReceiveForLift bool
ExportLiftLexicon object
FLExBridgeListener System
GetFullProjectFileName string
GetLiftPathname string
GetLiftRepositoryFolderFromFwProjectFolder string
ImportLiftCommon bool
ImportLiftLexicon object
IsConfiguredForLiftSR bool
IsConfiguredForSR bool
IsVernacularSpellingEnabled bool
JumpToFlexObject void
LinkedFilesLocationIsDefault bool
MoveOldLiftRepoIfNeeded bool
NotesFileHasContent bool
NotesFileIsPresent bool
OnDumperSetProgressMessage void
OnDumperUpdateProgress void
OnFLExBridge bool
OnLiftBridge bool
ParserSetProgressMessage void
ParserSetStepsCompleted void
ParserSetTotalNumberSteps void
PrepareToDetectLiftConflicts long>.Dictionary
PrepareToDetectMainConflicts long>.Dictionary
RefreshCacheWindowAndAll FwXWindow
RepeatPriorFailedImportIfNeeded bool
ReportDuplicateBridge void
RevisedProjectFolder string
RunFLExLiftBridge void
SaveAllDataToDisk void
ShowMessageBeforeFirstSendReceive_IsUserReady bool
StopParser void
UndoExport void
logger void

Public Methods

Method Description
CheckDisposed ( ) : void

This method throws an ObjectDisposedException if IsDisposed returns true. This is the case where a method or property in an object is being used but the object itself is no longer valid. This method should be added to all public properties and methods of this object and all other objects derived from it (extensive).

Dispose ( ) : void
ExportLiftLexicon ( ) : bool

Export the FieldWorks lexicon into the LIFT file. The file may, or may not, exist.

This method calls an overloaded ExportLiftLexicon, which is run in a thread.

GetMessageTargets ( ) : IxCoreColleague[]
ImportObtainedLexicon ( SIL.FieldWorks.FDO.FdoCache cache, string liftPath, Form parentForm ) : bool

This is invoked by reflection, due to almost insuperable sphaghetti in the relevant project references, from ChoooseLangProjectDialog.CreateProjectFromLift(). If you are tempted to rename the method, be sure to do so in ChoooseLangProjectDialog.CreateProjectFromLift(), as well.

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

The method/delegate that gets invoked when Send/Receive->"About" menu is clicked.

OnCheckForFlexBridgeUpdates ( object argument ) : bool

The method/delegate that gets invoked when Send/Receive->"Check for _Updates..." menu is clicked.

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

Called (by xcore) to control display params of the Send/Receive->"About" menu.

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

Called (by xcore) to control display params of the Send/Receive->"Check for _Updates..." menu.

OnDisplayFLExBridge ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to show the Send/Receive "_Project (with other FLEx users)" menu item.

OnDisplayFLExLiftBridge ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to enable the S/R toolbar icon and its hotkey. The button and hotkey always disabled before the first successful S/R.

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

Called (by xcore) to control display params of the Send/Receive Project menu.

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

Called (by xcore) to control display params of the Send/Receive "_Lexicon (with programs that use WeSay)" menu.

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

Called (by xcore) to control display params of the Send/Receive "_Lexicon (with programs that use WeSay)" menu.

OnDisplayObtainAnyFlexBridgeProject ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to show/enable the Send/Receive "_Get Project from Colleague" menu item.

OnDisplayObtainLiftProject ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to show the Send/Receive "Get and _Merge Lexicon with this Project" menu item.

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

Checks if the Send/Receive->"_Help..." menu is to be enabled.

OnDisplayViewLiftMessages ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to display the Send/Receive->"View Lexicon Messages" menu item.

OnDisplayViewMessages ( object parameters, XCore.UIItemDisplayProperties &display ) : bool

Determine whether or not to display the Send/Receive->"View Messages" menu item.

OnFLExLiftBridge ( object commandObject ) : bool

This is the button on the toolbar for FlexBridge and doing the last type of S/R (Flex or Lift)

OnFirstFLExBridge ( object commandObject ) : bool

Called to setup Send/Receive by FLExBridge the first time. Shows a brief instructional message, then, if the user is ready, calls through to OnFLExBridge.

OnFirstLiftBridge ( object commandObject ) : bool

Called to setup Send/Receive by LiftBridge the first time. Shows a brief instructional message, then, if the user is ready, calls through to OnLiftBridge.

OnObtainAnyFlexBridgeProject ( object commandObject ) : bool

Handle the S/R "_Get Project from Colleague" menu option.

OnObtainLiftProject ( object commandObject ) : bool

Handles the "Get and _Merge Lexicon with this Project" menu item.

OnShowChorusHelp ( object argument ) : bool

Handles the OnShowChorusHelp Mediator message for the Send/Receive->"_About..." menu.

OnViewLiftMessages ( object commandObject ) : bool

The method/delegate that gets invoked when Send/Receive->"View Lexicon Messages" is clicked

OnViewMessages ( object commandObject ) : bool

The method/delegate that gets invoked when Send/Receive->View Messages is clicked

If you change the name of this method, you need to check for calls to SendMessage("ViewMessages").

OnWarnUserAboutFailedLiftImportIfNecessary ( object param ) : bool

Private Methods

Method Description
BroadcastMasterRefresh ( ) : void

Callback to refresh the Message Slice after OnView[Lift]Messages

CheckForExistingFileName ( string projectFolder, string revisedFileName ) : bool
CheckForFlexBridgeInstalledAndSetMenuItemProperties ( XCore.UIItemDisplayProperties display ) : void
ConvertFlexNotesToLift ( TextReader reader, TextWriter writer, string liftFileName ) : void

Convert FLEx ChorusNotes file referencing lex entries to LIFT notes by adjusting the "ref" attributes.

ConvertLiftNotesToFlex ( TextReader reader, TextWriter writer, string liftFileName ) : void

Convert LIFT ChorusNotes file to FLEx notes by adjusting the "ref" attributes.

ConvertRefAttrs ( TextReader reader, TextWriter writer, string liftFileName, string outputTemplate ) : void
DetectLiftConflicts ( string path, long>.Dictionary savedState ) : bool
DetectMainConflicts ( string path, long>.Dictionary savedState ) : bool
Dispose ( bool fDisposing ) : void
DoMercilessLiftImport ( bool dataChanged ) : bool
DoSendReceiveForLift ( string fullProjectFileName, bool &dataChanged ) : bool

Do the S/R. This *may* actually create the Lift repository, if it doesn't exist, or it may do a more normal S/R

ExportLiftLexicon ( IProgress progressDialog ) : object

Export the contents of the lift lexicon.

This method is called in a thread, during the export process.

FLExBridgeListener ( ) : System
GetFullProjectFileName ( ) : string
GetLiftPathname ( string liftBaseDir ) : string
GetLiftRepositoryFolderFromFwProjectFolder ( string projectFolder ) : string
ImportLiftCommon ( FlexLiftMerger mergeStyle ) : bool

Import the lift file using the given MergeStyle: FlexLiftMerger.MergeStyle.MsKeepNew (aka 'merciful', in that all entries from lift file and those in FLEx are retained) FlexLiftMerger.MergeStyle.MsKeepOnlyNew (aka 'merciless', in that the Flex lexicon ends up with the same entries as in the lift file, even if some need to be deleted in FLEx.)

ImportLiftLexicon ( IProgress progressDialog ) : object

Import the LIFT file into FieldWorks.

This method is called in a thread, during the export process.

IsConfiguredForLiftSR ( string folder ) : bool
IsConfiguredForSR ( string projectFolder ) : bool
IsVernacularSpellingEnabled ( XCore.Mediator mediator ) : bool
JumpToFlexObject ( object sender, FLExJumpEventArgs e ) : void
LinkedFilesLocationIsDefault ( ) : bool
MoveOldLiftRepoIfNeeded ( ) : bool

If the repo exists in the foo\OtherRepositories\LIFT folder, then do nothing. If the repo or the entire folder structure does not yet exist, then ask FLEx Bridge to move the previous lift repo to the new home, it is exists.

If the call to FLEx Bridge returns the pathname to the lift file (_liftPathname), we know the move took place, and we have the lift file that is in the repository. That lift file's name may or may not match the FW project name, but it ought not matter if it does or does not match.

If the call returned null, we know the move did not take place. In this case the caller of this method will continue on and probably create a new repository, thus doing the equivalent of the original Lift Bridge code where there FLEx user started a S/R lift system.

NotesFileHasContent ( string chorusNotesPathname ) : bool
NotesFileIsPresent ( SIL.FieldWorks.FDO.FdoCache cache, bool checkForLiftNotes ) : bool

Returns true if there are any Chorus Notes to view in the main FW repo or in the Lift repo.

OnDumperSetProgressMessage ( object sender, SIL.FieldWorks.Common.FwUtils.ProgressMessageArgs e ) : void
OnDumperUpdateProgress ( object sender ) : void
OnFLExBridge ( object commandObject ) : bool
OnLiftBridge ( object argument ) : bool
ParserSetProgressMessage ( object sender, LiftParser e ) : void
ParserSetStepsCompleted ( object sender, LiftParser e ) : void
ParserSetTotalNumberSteps ( object sender, LiftParser e ) : void
PrepareToDetectLiftConflicts ( string liftPath ) : long>.Dictionary

This is only used for the Lift repo folder.

PrepareToDetectMainConflicts ( string projectFolder ) : long>.Dictionary

This is only used for the main FW repo, so it excludes any notes in a lower level repo.

RefreshCacheWindowAndAll ( SIL.FieldWorks.XWorks.LexText.LexTextApp app, string fullProjectFileName ) : FwXWindow
RepeatPriorFailedImportIfNeeded ( ) : bool

Reregisters an import failure, if needed, otherwise clears the token.

ReportDuplicateBridge ( ) : void
RevisedProjectFolder ( string oldProjectFolder, string revisedProjName ) : string
RunFLExLiftBridge ( object commandObject ) : void
SaveAllDataToDisk ( ) : void
ShowMessageBeforeFirstSendReceive_IsUserReady ( ) : bool
StopParser ( ) : void

We don't want the parser running, and perhaps making changes in the background, during any kind of S/R.

UndoExport ( ) : void
logger ( string guid, string date, string description ) : void

Method Details

CheckDisposed() public method

This method throws an ObjectDisposedException if IsDisposed returns true. This is the case where a method or property in an object is being used but the object itself is no longer valid. This method should be added to all public properties and methods of this object and all other objects derived from it (extensive).
public CheckDisposed ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

ExportLiftLexicon() public method

Export the FieldWorks lexicon into the LIFT file. The file may, or may not, exist.
This method calls an overloaded ExportLiftLexicon, which is run in a thread.
public ExportLiftLexicon ( ) : bool
return bool

GetMessageTargets() public method

public GetMessageTargets ( ) : IxCoreColleague[]
return IxCoreColleague[]

ImportObtainedLexicon() public static method

This is invoked by reflection, due to almost insuperable sphaghetti in the relevant project references, from ChoooseLangProjectDialog.CreateProjectFromLift(). If you are tempted to rename the method, be sure to do so in ChoooseLangProjectDialog.CreateProjectFromLift(), as well.
public static ImportObtainedLexicon ( SIL.FieldWorks.FDO.FdoCache cache, string liftPath, Form parentForm ) : bool
cache SIL.FieldWorks.FDO.FdoCache
liftPath string
parentForm System.Windows.Forms.Form
return bool

Init() public method

public Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System.Xml.XmlNode
return void

OnAboutFlexBridge() public method

The method/delegate that gets invoked when Send/Receive->"About" menu is clicked.
public OnAboutFlexBridge ( object argument ) : bool
argument object Includes the XML command element of the OnAboutFlexBridge message
return bool

OnCheckForFlexBridgeUpdates() public method

The method/delegate that gets invoked when Send/Receive->"Check for _Updates..." menu is clicked.
public OnCheckForFlexBridgeUpdates ( object argument ) : bool
argument object Includes the XML command element of the OnAboutFlexBridge message
return bool

OnDisplayAboutFlexBridge() public method

Called (by xcore) to control display params of the Send/Receive->"About" menu.
public OnDisplayAboutFlexBridge ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayCheckForFlexBridgeUpdates() public method

Called (by xcore) to control display params of the Send/Receive->"Check for _Updates..." menu.
public OnDisplayCheckForFlexBridgeUpdates ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayFLExBridge() public method

Determine whether or not to show the Send/Receive "_Project (with other FLEx users)" menu item.
public OnDisplayFLExBridge ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnDisplayFLExLiftBridge() public method

Determine whether or not to enable the S/R toolbar icon and its hotkey. The button and hotkey always disabled before the first successful S/R.
public OnDisplayFLExLiftBridge ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnDisplayFirstFLExBridge() public method

Called (by xcore) to control display params of the Send/Receive Project menu.
public OnDisplayFirstFLExBridge ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayFirstLiftBridge() public method

Called (by xcore) to control display params of the Send/Receive "_Lexicon (with programs that use WeSay)" menu.
public OnDisplayFirstLiftBridge ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayLiftBridge() public method

Called (by xcore) to control display params of the Send/Receive "_Lexicon (with programs that use WeSay)" menu.
public OnDisplayLiftBridge ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayObtainAnyFlexBridgeProject() public method

Determine whether or not to show/enable the Send/Receive "_Get Project from Colleague" menu item.
public OnDisplayObtainAnyFlexBridgeProject ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnDisplayObtainLiftProject() public method

Determine whether or not to show the Send/Receive "Get and _Merge Lexicon with this Project" menu item.
public OnDisplayObtainLiftProject ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnDisplayShowChorusHelp() public method

Checks if the Send/Receive->"_Help..." menu is to be enabled.
public OnDisplayShowChorusHelp ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayViewLiftMessages() public method

Determine whether or not to display the Send/Receive->"View Lexicon Messages" menu item.
public OnDisplayViewLiftMessages ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnDisplayViewMessages() public method

Determine whether or not to display the Send/Receive->"View Messages" menu item.
public OnDisplayViewMessages ( object parameters, XCore.UIItemDisplayProperties &display ) : bool
parameters object
display XCore.UIItemDisplayProperties
return bool

OnFLExLiftBridge() public method

This is the button on the toolbar for FlexBridge and doing the last type of S/R (Flex or Lift)
public OnFLExLiftBridge ( object commandObject ) : bool
commandObject object
return bool

OnFirstFLExBridge() public method

Called to setup Send/Receive by FLExBridge the first time. Shows a brief instructional message, then, if the user is ready, calls through to OnFLExBridge.
public OnFirstFLExBridge ( object commandObject ) : bool
commandObject object
return bool

OnFirstLiftBridge() public method

Called to setup Send/Receive by LiftBridge the first time. Shows a brief instructional message, then, if the user is ready, calls through to OnLiftBridge.
public OnFirstLiftBridge ( object commandObject ) : bool
commandObject object
return bool

OnObtainAnyFlexBridgeProject() public method

Handle the S/R "_Get Project from Colleague" menu option.
public OnObtainAnyFlexBridgeProject ( object commandObject ) : bool
commandObject object
return bool

OnObtainLiftProject() public method

Handles the "Get and _Merge Lexicon with this Project" menu item.
public OnObtainLiftProject ( object commandObject ) : bool
commandObject object
return bool

OnShowChorusHelp() public method

Handles the OnShowChorusHelp Mediator message for the Send/Receive->"_About..." menu.
public OnShowChorusHelp ( object argument ) : bool
argument object
return bool

OnViewLiftMessages() public method

The method/delegate that gets invoked when Send/Receive->"View Lexicon Messages" is clicked
public OnViewLiftMessages ( object commandObject ) : bool
commandObject object Includes the XML command element of the OnViewLiftMessages message
return bool

OnViewMessages() public method

The method/delegate that gets invoked when Send/Receive->View Messages is clicked
If you change the name of this method, you need to check for calls to SendMessage("ViewMessages").
public OnViewMessages ( object commandObject ) : bool
commandObject object Includes the XML command element of the OnViewMessages message
return bool

OnWarnUserAboutFailedLiftImportIfNecessary() public method

public OnWarnUserAboutFailedLiftImportIfNecessary ( object param ) : bool
param object
return bool