C# Class SIL.FieldWorks.TE.DraftView

Implementation of the draft view (formerly SeDraftWnd)
Inheritance: SIL.FieldWorks.TE.DraftViewBase, ISelectableView
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Свойство Type Description
m_fShowInTable bool
m_helpTopicProvider IHelpTopicProvider

Private Properties

Свойство Type Description
ConvertBookTagAndIndex void
FindNextTranslationInText int
FindPrevTranslationInText int
GetBackTranslationStatus BackTranslationStatus
IsKeyTermsView bool
MoveToNextTranslation void
MoveToPrevTranslation void
ReplaceBookTagAndIndex void
ShowPrintDlgHelp void
SynchFootnoteView void
SynchFootnoteView void

Méthodes publiques

Méthode Description
ActivateView ( ) : void

Activates the view and initializes the information bar and styles combo based on the draft view's selection.

DeactivateView ( ) : void

DoHotLinkAction ( object sender, string strData ) : void

Handle hot link action - user clicked on hot link on the view.

DraftView ( FdoCache cache, int filterInstance, IApp app, string viewName, bool fEditable, bool fShowInTable, bool fMakeRootAutomatically, TeViewType viewType, int btWs, IHelpTopicProvider helpTopicProvider ) : System

Initializes a new instance of the DraftView class as a draft view editing pane, for either vernacular or back translation.

GetWritingSystemForHvo ( int hvo ) : int

Gets the writing system for the HVO. This could either be the vernacular or analysis writing system.

OnFilePrint ( object args ) : bool

OnInsertDiffPara ( IVwRootBox rootBox, ITsTextProps ttpDest, ITsTextProps ttpSrc, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse

see OnInsertDiffParas

OnInsertDiffParas ( IVwRootBox rootBox, ITsTextProps ttpDest, int cPara, ITsTextProps ttpSrcArray, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse

Handle insertion of paragraphs (i.e., from clipboard) with properties that don't match the properties of the paragraph where they are being inserted. This gives us the opportunity to create/modify the DB structure to recieve the paragraphs being inserted and to reject certain types of paste operations (such as attempting to paste a book).

OnProblemDeletion ( IVwSelection sel, VwDelProbType dpt ) : VwDelProbResponse

Handle a problem deletion - a complex selection crossing sections or other difficult cases such as BS/DEL at boundaries.

SelectRangeOfChars ( int book, int section, int para, int startCharacter, int endCharacter ) : SelectionHelper

Set an insertion point or character-range selection in this DraftView which is "installed" and scrolled into view.

This method is only used for tests

SetInsertionPoint ( int book, int section, int para, int character, bool fAssocPrev ) : SelectionHelper

Set the insertion point in this draftview to the specified location.

ShowContextMenuAtIp ( IVwRootBox rootb ) : void

Show the context menu for the specified root box at the location of its selection (typically an IP).

Méthodes protégées

Méthode Description
CallMouseDown ( Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot ) : void

Remember if a picture is selected so that it can be deselected on mouse up, if necessary.

CallMouseUp ( Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot ) : void

Call MouseUp on the rootbox

CreateEditingHelper ( ) : EditingHelper

Provide a TE specific implementation of the EditingHelper

CreateEditingHelper_Internal ( ) : TeEditingHelper

Internal version of CreateEditingHelper allows subclasses to override to create a subclass of TeEditingHelper without repeating the common initialization code.

CreateViewConstructor ( ) : TeStVc

Creates a view constructor suitable for this kind of view.

GetNonFocusedSelectionState ( Control windowGainingFocus ) : VwSelectionState

If the annotations window is gaining focus, then we don't want the draft view's range selections to be hidden.

HandleSelectionChange ( IVwRootBox rootb, IVwSelection vwselNew ) : void

Handle a selection changed event.

OnBackTranslationChecked ( object args ) : bool

Handle a click on the Back Translation Checked menu option

OnBackTranslationFinished ( object args ) : bool

Handle a click on the Back Translation Finished menu option

OnBackTranslationNextUnfinished ( object args ) : bool

Move to the next paragraph in the back translation that is unfinished.

OnBackTranslationPrevUnfinished ( object args ) : bool

Move to the previous paragraph in the back translation that is unfinished.

OnBackTranslationUnfinished ( object args ) : bool

Handle a click on the Back Translation Unfinished menu option

OnDeleteFootnote ( object args ) : bool

Deletes a footnote when the selection is on a footnote marker. Called from context menu.

OnGotFocus ( EventArgs e ) : void

Focus got set to the draft view

OnKeyPress ( KeyPressEventArgs e ) : void

Override to try to repair the situation if re-inserting a missing-data prompt causes there to be no selection.

OnLoadSettings ( RegistryKey key ) : void

Load settings from the registry

OnLostFocus ( EventArgs e ) : void

Raises the E:System.Windows.Forms.Control.LostFocus event.

OnMouseUp ( MouseEventArgs e ) : void

Handle the mouse up event.

OnSaveSettings ( RegistryKey key ) : void

Save passage to the registry

OnUpdateBackTranslationChecked ( object args ) : bool

OnUpdateBackTranslationFinished ( object args ) : bool

OnUpdateBackTranslationNextUnfinished ( object args ) : bool

Update handler for the Next Unfinished Paragraph button

OnUpdateBackTranslationPrevUnfinished ( object args ) : bool

Update handler for the Prev Unfinished Paragraph button

OnUpdateBackTranslationUnfinished ( object args ) : bool

OnUpdateInformationBar ( object args ) : bool

Handles a queued event that will be processed during idle cycles. This will update the information tool bar.

SetBackTranslationStatus ( ICmTranslation trans, BackTranslationStatus status ) : void

Set the status of a back translation object.

SetInsertionPoint ( int tag, int book, int section ) : SelectionHelper

Navigate to the beginning of any Scripture element: Title, Section Head, or Section Content.

SetInsertionPoint ( int tag, int book, int section, int paragraph ) : SelectionHelper

Navigate to the beginning of any Scripture element: Title, Section Head, or Section Content.

SetupPrintHelp ( PrintDialog dlg ) : void

If help is available for the print dialog, set ShowHelp to true, and add an event handler that can display some help. TE has such help available.

ShowContextMenu ( Point loc ) : void

Shows the context menu.

Private Methods

Méthode Description
ConvertBookTagAndIndex ( SelectionHelper helper, SelectionHelper selType ) : void

Convert the scripture book tag to a filter tag. Also, convert book indices to filtered book indices. This is done when loading a selection to make it work in the context of the book filter.

FindNextTranslationInText ( IStText text, int iParaStartSearch, bool>.Func condition ) : int

Look for a translation with a matching status in a paragraph of an StText

FindPrevTranslationInText ( IStText text, BackTranslationStatus searchStatus, int iParaStartSearch ) : int

Look for a previous translation with a matching status in a paragraph of an StText

GetBackTranslationStatus ( ICmTranslation trans ) : BackTranslationStatus

Get the status of a back translation object

IsKeyTermsView ( ) : bool
MoveToNextTranslation ( SelectionHelper selection, bool>.Func condition ) : void

Find and select the next translation meeting a given condition

MoveToPrevTranslation ( SelectionHelper selection, BackTranslationStatus searchStatus ) : void

Find and select the previous translation with a given state

ReplaceBookTagAndIndex ( SelectionHelper helper, SelectionHelper selType ) : void

Replace the filter book tag with a scrpiture books tag. This is done before persisting the selection because the filter tag is not valid across sessions. Also, any filtered book indices are replaced with real scripture book indices for the same reason.

ShowPrintDlgHelp ( object sender, EventArgs e ) : void

Show help for the print dialog

SynchFootnoteView ( ) : void

Synchronizes the footnote view.

SynchFootnoteView ( SelectionHelper helper ) : void

Synchronizes the footnote view.

Method Details

ActivateView() public méthode

Activates the view and initializes the information bar and styles combo based on the draft view's selection.
public ActivateView ( ) : void
Résultat void

CallMouseDown() protected méthode

Remember if a picture is selected so that it can be deselected on mouse up, if necessary.
protected CallMouseDown ( Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot ) : void
pt Point
rcSrcRoot Rectangle
rcDstRoot Rectangle
Résultat void

CallMouseUp() protected méthode

Call MouseUp on the rootbox
protected CallMouseUp ( Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot ) : void
pt Point
rcSrcRoot Rectangle
rcDstRoot Rectangle
Résultat void

CreateEditingHelper() protected méthode

Provide a TE specific implementation of the EditingHelper
protected CreateEditingHelper ( ) : EditingHelper
Résultat EditingHelper

CreateEditingHelper_Internal() protected méthode

Internal version of CreateEditingHelper allows subclasses to override to create a subclass of TeEditingHelper without repeating the common initialization code.
protected CreateEditingHelper_Internal ( ) : TeEditingHelper
Résultat TeEditingHelper

CreateViewConstructor() protected méthode

Creates a view constructor suitable for this kind of view.
protected CreateViewConstructor ( ) : TeStVc
Résultat TeStVc

DeactivateView() public méthode

public DeactivateView ( ) : void
Résultat void

DoHotLinkAction() public méthode

Handle hot link action - user clicked on hot link on the view.
public DoHotLinkAction ( object sender, string strData ) : void
sender object Ignored. The view constructor that detected the click
strData string String-representation of the link, including the type of link /// and the GUID of the linked object
Résultat void

DraftView() public méthode

Initializes a new instance of the DraftView class as a draft view editing pane, for either vernacular or back translation.
public DraftView ( FdoCache cache, int filterInstance, IApp app, string viewName, bool fEditable, bool fShowInTable, bool fMakeRootAutomatically, TeViewType viewType, int btWs, IHelpTopicProvider helpTopicProvider ) : System
cache FdoCache The cache.
filterInstance int The tag that identifies the book filter instance.
app IApp The application.
viewName string The name of the view.
fEditable bool true if view is to be editable.
fShowInTable bool true if the paragraphs are to be displayed in a /// table.
fMakeRootAutomatically bool true to make the root automatically /// when the window handle is created.
viewType TeViewType Bit-flags indicating type of view.
btWs int The back translation writing system (if needed).
helpTopicProvider IHelpTopicProvider The help topic provider.
Résultat System

GetNonFocusedSelectionState() protected méthode

If the annotations window is gaining focus, then we don't want the draft view's range selections to be hidden.
protected GetNonFocusedSelectionState ( Control windowGainingFocus ) : VwSelectionState
windowGainingFocus Control
Résultat VwSelectionState

GetWritingSystemForHvo() public méthode

Gets the writing system for the HVO. This could either be the vernacular or analysis writing system.
public GetWritingSystemForHvo ( int hvo ) : int
hvo int HVO
Résultat int

HandleSelectionChange() protected méthode

Handle a selection changed event.
protected HandleSelectionChange ( IVwRootBox rootb, IVwSelection vwselNew ) : void
rootb IVwRootBox root box that has the selection change
vwselNew IVwSelection Selection
Résultat void

OnBackTranslationChecked() protected méthode

Handle a click on the Back Translation Checked menu option
protected OnBackTranslationChecked ( object args ) : bool
args object
Résultat bool

OnBackTranslationFinished() protected méthode

Handle a click on the Back Translation Finished menu option
protected OnBackTranslationFinished ( object args ) : bool
args object
Résultat bool

OnBackTranslationNextUnfinished() protected méthode

Move to the next paragraph in the back translation that is unfinished.
protected OnBackTranslationNextUnfinished ( object args ) : bool
args object
Résultat bool

OnBackTranslationPrevUnfinished() protected méthode

Move to the previous paragraph in the back translation that is unfinished.
protected OnBackTranslationPrevUnfinished ( object args ) : bool
args object
Résultat bool

OnBackTranslationUnfinished() protected méthode

Handle a click on the Back Translation Unfinished menu option
protected OnBackTranslationUnfinished ( object args ) : bool
args object
Résultat bool

OnDeleteFootnote() protected méthode

Deletes a footnote when the selection is on a footnote marker. Called from context menu.
protected OnDeleteFootnote ( object args ) : bool
args object
Résultat bool

OnFilePrint() public méthode

public OnFilePrint ( object args ) : bool
args object
Résultat bool

OnGotFocus() protected méthode

Focus got set to the draft view
protected OnGotFocus ( EventArgs e ) : void
e EventArgs The event data
Résultat void

OnInsertDiffPara() public méthode

see OnInsertDiffParas
public OnInsertDiffPara ( IVwRootBox rootBox, ITsTextProps ttpDest, ITsTextProps ttpSrc, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse
rootBox IVwRootBox
ttpDest ITsTextProps
ttpSrc ITsTextProps
tssParas ITsString
tssTrailing ITsString
Résultat VwInsertDiffParaResponse

OnInsertDiffParas() public méthode

Handle insertion of paragraphs (i.e., from clipboard) with properties that don't match the properties of the paragraph where they are being inserted. This gives us the opportunity to create/modify the DB structure to recieve the paragraphs being inserted and to reject certain types of paste operations (such as attempting to paste a book).
public OnInsertDiffParas ( IVwRootBox rootBox, ITsTextProps ttpDest, int cPara, ITsTextProps ttpSrcArray, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse
rootBox IVwRootBox the sender
ttpDest ITsTextProps properties of destination paragraph
cPara int number of paragraphs to be inserted
ttpSrcArray ITsTextProps Array of props of each para to be inserted
tssParas ITsString Array of TsStrings for each para to be inserted
tssTrailing ITsString Text of an incomplete paragraph to insert at end (with /// the properties of the destination paragraph.
Résultat VwInsertDiffParaResponse

OnKeyPress() protected méthode

Override to try to repair the situation if re-inserting a missing-data prompt causes there to be no selection.
protected OnKeyPress ( KeyPressEventArgs e ) : void
e KeyPressEventArgs
Résultat void

OnLoadSettings() protected méthode

Load settings from the registry
protected OnLoadSettings ( RegistryKey key ) : void
key RegistryKey Location in the registry
Résultat void

OnLostFocus() protected méthode

Raises the E:System.Windows.Forms.Control.LostFocus event.
protected OnLostFocus ( EventArgs e ) : void
e EventArgs An that contains the event data.
Résultat void

OnMouseUp() protected méthode

Handle the mouse up event.
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnProblemDeletion() public méthode

Handle a problem deletion - a complex selection crossing sections or other difficult cases such as BS/DEL at boundaries.
public OnProblemDeletion ( IVwSelection sel, VwDelProbType dpt ) : VwDelProbResponse
sel IVwSelection
dpt VwDelProbType
Résultat VwDelProbResponse

OnSaveSettings() protected méthode

Save passage to the registry
protected OnSaveSettings ( RegistryKey key ) : void
key RegistryKey Location in the registry
Résultat void

OnUpdateBackTranslationChecked() protected méthode

protected OnUpdateBackTranslationChecked ( object args ) : bool
args object
Résultat bool

OnUpdateBackTranslationFinished() protected méthode

protected OnUpdateBackTranslationFinished ( object args ) : bool
args object
Résultat bool

OnUpdateBackTranslationNextUnfinished() protected méthode

Update handler for the Next Unfinished Paragraph button
protected OnUpdateBackTranslationNextUnfinished ( object args ) : bool
args object
Résultat bool

OnUpdateBackTranslationPrevUnfinished() protected méthode

Update handler for the Prev Unfinished Paragraph button
protected OnUpdateBackTranslationPrevUnfinished ( object args ) : bool
args object
Résultat bool

OnUpdateBackTranslationUnfinished() protected méthode

protected OnUpdateBackTranslationUnfinished ( object args ) : bool
args object
Résultat bool

OnUpdateInformationBar() protected méthode

Handles a queued event that will be processed during idle cycles. This will update the information tool bar.
protected OnUpdateInformationBar ( object args ) : bool
args object
Résultat bool

SelectRangeOfChars() public méthode

Set an insertion point or character-range selection in this DraftView which is "installed" and scrolled into view.
This method is only used for tests
public SelectRangeOfChars ( int book, int section, int para, int startCharacter, int endCharacter ) : SelectionHelper
book int The 0-based index of the Scripture book in which to put the /// insertion point
section int The 0-based index of the Scripture section in which to put the /// insertion point
para int The 0-based index of the paragraph in which to put the insertion /// point
startCharacter int The 0-based index of the character at which the /// selection begins (or before which the insertion point is to be placed if /// startCharacter == endCharacter)
endCharacter int The character location to end the selection
Résultat SelectionHelper

SetBackTranslationStatus() protected méthode

Set the status of a back translation object.
protected SetBackTranslationStatus ( ICmTranslation trans, BackTranslationStatus status ) : void
trans ICmTranslation
status BackTranslationStatus
Résultat void

SetInsertionPoint() protected méthode

Navigate to the beginning of any Scripture element: Title, Section Head, or Section Content.
protected SetInsertionPoint ( int tag, int book, int section ) : SelectionHelper
tag int Indicates whether selection should be made in the title, section /// Heading or section Content
book int The 0-based index of the Scripture book in which to put the /// insertion point
section int The 0-based index of the Scripture section in which to put the /// insertion point. Ignored if tag is ///
Résultat SelectionHelper

SetInsertionPoint() protected méthode

Navigate to the beginning of any Scripture element: Title, Section Head, or Section Content.
protected SetInsertionPoint ( int tag, int book, int section, int paragraph ) : SelectionHelper
tag int Indicates whether selection should be made in the title, section /// Heading or section Content
book int The 0-based index of the Scripture book in which to put the /// insertion point
section int The 0-based index of the Scripture section in which to put the /// insertion point. Ignored if tag is ///
paragraph int The 0-based index of the paragraph which to put the /// insertion point.
Résultat SelectionHelper

SetInsertionPoint() public méthode

Set the insertion point in this draftview to the specified location.
public SetInsertionPoint ( int book, int section, int para, int character, bool fAssocPrev ) : SelectionHelper
book int The 0-based index of the Scripture book in which to put the /// insertion point
section int The 0-based index of the Scripture section in which to put the /// insertion point
para int The 0-based index of the paragraph in which to put the insertion /// point
character int The 0-based index of the character before which the /// insertion point is to be placed
fAssocPrev bool True if the properties of the text entered at the new /// insertion point should be associated with the properties of the text before the new /// insertion point. False if text entered at the new insertion point should be /// associated with the text following the new insertion point.
Résultat SelectionHelper

SetupPrintHelp() protected méthode

If help is available for the print dialog, set ShowHelp to true, and add an event handler that can display some help. TE has such help available.
protected SetupPrintHelp ( PrintDialog dlg ) : void
dlg PrintDialog
Résultat void

ShowContextMenu() protected méthode

Shows the context menu.
protected ShowContextMenu ( Point loc ) : void
loc Point The loc.
Résultat void

ShowContextMenuAtIp() public méthode

Show the context menu for the specified root box at the location of its selection (typically an IP).
public ShowContextMenuAtIp ( IVwRootBox rootb ) : void
rootb IVwRootBox
Résultat void

Property Details

m_fShowInTable protected_oe property

true to layout data in a table
protected bool m_fShowInTable
Résultat bool

m_helpTopicProvider protected_oe property

protected IHelpTopicProvider m_helpTopicProvider
Résultat IHelpTopicProvider