C# Класс SIL.FieldWorks.TE.DraftView

Implementation of the draft view (formerly SeDraftWnd)
Наследование: SIL.FieldWorks.TE.DraftViewBase, ISelectableView
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
m_fShowInTable bool
m_helpTopicProvider IHelpTopicProvider

Private Properties

Свойство Тип Описание
ConvertBookTagAndIndex void
FindNextTranslationInText int
FindPrevTranslationInText int
GetBackTranslationStatus BackTranslationStatus
IsKeyTermsView bool
MoveToNextTranslation void
MoveToPrevTranslation void
ReplaceBookTagAndIndex void
ShowPrintDlgHelp void
SynchFootnoteView void
SynchFootnoteView void

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

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

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

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

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

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

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

ActivateView() публичный метод

Activates the view and initializes the information bar and styles combo based on the draft view's selection.
public ActivateView ( ) : void
Результат void

CallMouseDown() защищенный метод

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

CallMouseUp() защищенный метод

Call MouseUp on the rootbox
protected CallMouseUp ( Point pt, Rectangle rcSrcRoot, Rectangle rcDstRoot ) : void
pt Point
rcSrcRoot Rectangle
rcDstRoot Rectangle
Результат void

CreateEditingHelper() защищенный метод

Provide a TE specific implementation of the EditingHelper
protected CreateEditingHelper ( ) : EditingHelper
Результат EditingHelper

CreateEditingHelper_Internal() защищенный метод

Internal version of CreateEditingHelper allows subclasses to override to create a subclass of TeEditingHelper without repeating the common initialization code.
protected CreateEditingHelper_Internal ( ) : TeEditingHelper
Результат TeEditingHelper

CreateViewConstructor() защищенный метод

Creates a view constructor suitable for this kind of view.
protected CreateViewConstructor ( ) : TeStVc
Результат TeStVc

DeactivateView() публичный метод

public DeactivateView ( ) : void
Результат void

DoHotLinkAction() публичный метод

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

DraftView() публичный метод

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

GetNonFocusedSelectionState() защищенный метод

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

GetWritingSystemForHvo() публичный метод

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

HandleSelectionChange() защищенный метод

Handle a selection changed event.
protected HandleSelectionChange ( IVwRootBox rootb, IVwSelection vwselNew ) : void
rootb IVwRootBox root box that has the selection change
vwselNew IVwSelection Selection
Результат void

OnBackTranslationChecked() защищенный метод

Handle a click on the Back Translation Checked menu option
protected OnBackTranslationChecked ( object args ) : bool
args object
Результат bool

OnBackTranslationFinished() защищенный метод

Handle a click on the Back Translation Finished menu option
protected OnBackTranslationFinished ( object args ) : bool
args object
Результат bool

OnBackTranslationNextUnfinished() защищенный метод

Move to the next paragraph in the back translation that is unfinished.
protected OnBackTranslationNextUnfinished ( object args ) : bool
args object
Результат bool

OnBackTranslationPrevUnfinished() защищенный метод

Move to the previous paragraph in the back translation that is unfinished.
protected OnBackTranslationPrevUnfinished ( object args ) : bool
args object
Результат bool

OnBackTranslationUnfinished() защищенный метод

Handle a click on the Back Translation Unfinished menu option
protected OnBackTranslationUnfinished ( object args ) : bool
args object
Результат bool

OnDeleteFootnote() защищенный метод

Deletes a footnote when the selection is on a footnote marker. Called from context menu.
protected OnDeleteFootnote ( object args ) : bool
args object
Результат bool

OnFilePrint() публичный метод

public OnFilePrint ( object args ) : bool
args object
Результат bool

OnGotFocus() защищенный метод

Focus got set to the draft view
protected OnGotFocus ( EventArgs e ) : void
e EventArgs The event data
Результат void

OnInsertDiffPara() публичный метод

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

OnInsertDiffParas() публичный метод

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

OnKeyPress() защищенный метод

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

OnLoadSettings() защищенный метод

Load settings from the registry
protected OnLoadSettings ( RegistryKey key ) : void
key RegistryKey Location in the registry
Результат void

OnLostFocus() защищенный метод

Raises the E:System.Windows.Forms.Control.LostFocus event.
protected OnLostFocus ( EventArgs e ) : void
e EventArgs An that contains the event data.
Результат void

OnMouseUp() защищенный метод

Handle the mouse up event.
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnProblemDeletion() публичный метод

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

OnSaveSettings() защищенный метод

Save passage to the registry
protected OnSaveSettings ( RegistryKey key ) : void
key RegistryKey Location in the registry
Результат void

OnUpdateBackTranslationChecked() защищенный метод

protected OnUpdateBackTranslationChecked ( object args ) : bool
args object
Результат bool

OnUpdateBackTranslationFinished() защищенный метод

protected OnUpdateBackTranslationFinished ( object args ) : bool
args object
Результат bool

OnUpdateBackTranslationNextUnfinished() защищенный метод

Update handler for the Next Unfinished Paragraph button
protected OnUpdateBackTranslationNextUnfinished ( object args ) : bool
args object
Результат bool

OnUpdateBackTranslationPrevUnfinished() защищенный метод

Update handler for the Prev Unfinished Paragraph button
protected OnUpdateBackTranslationPrevUnfinished ( object args ) : bool
args object
Результат bool

OnUpdateBackTranslationUnfinished() защищенный метод

protected OnUpdateBackTranslationUnfinished ( object args ) : bool
args object
Результат bool

OnUpdateInformationBar() защищенный метод

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

SelectRangeOfChars() публичный метод

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

SetBackTranslationStatus() защищенный метод

Set the status of a back translation object.
protected SetBackTranslationStatus ( ICmTranslation trans, BackTranslationStatus status ) : void
trans ICmTranslation
status BackTranslationStatus
Результат void

SetInsertionPoint() защищенный метод

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

SetInsertionPoint() защищенный метод

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

SetInsertionPoint() публичный метод

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

SetupPrintHelp() защищенный метод

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

ShowContextMenu() защищенный метод

Shows the context menu.
protected ShowContextMenu ( Point loc ) : void
loc Point The loc.
Результат void

ShowContextMenuAtIp() публичный метод

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

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

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

true to layout data in a table
protected bool m_fShowInTable
Результат bool

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

protected IHelpTopicProvider m_helpTopicProvider
Результат IHelpTopicProvider