C# Class SIL.FieldWorks.XWorks.XmlDocView

XmlDocView is a view that shows a complete list as a single view. A RecordClerk class does most of the work of managing the list and current object. list management and navigation is entirely(?) handled by the RecordClerk. The actual view of each object is specified by a child node of the view node. This specifies how to display an individual list item.
Inheritance: SIL.FieldWorks.XWorks.XWorksViewBase
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_configObjectName string
m_currentIndex int
m_currentObject ICmObject
m_hvoOwner int
m_mainView SIL.FieldWorks.Common.Controls.XmlSeqView

Private Properties

Property Type Description
AdjustedClerkIndex int
BaseLayoutName string
DisposeTooltip void
ExtractLayoutsFromLayoutTypeList string>>.IEnumerable
FindViewNameInList string
GatherBuiltInAndUserLayouts string>>.IEnumerable
GetBuiltInLayouts string>>.IEnumerable
GetPublicationName string
GetSafeWsName string
GetSelectedConfigView string
GetSelectedPublication string
GetTarget ICmObject
GetUserDefinedDictLayouts string>>.IEnumerable
GetWidthOfStringInPixels int
GiveSimpleWarning void
InitializeComponent void
IsCurrentConfigViewChanged bool
IsCurrentPublicationChanged bool
IsCurrentReversalWsChanged bool
IsDesiredPublication bool
IsObjectVisible bool
MakePublicationTitlePart string
NoReasonToChangeTitle bool
OnMouseClick void
ResetSpacer void
RunConfigureDialog void
SelectAndScrollToCurrentRecord void
SetConfigViewTitle void
SubitemClicked ICmObject
SubitemClicked ICmObject
TrimToMaxPixelWidth string
TryToJumpToSelection void

Public Methods

Method Description
GetPubDecorator ( ) : DictionaryPublicationDecorator
Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
OnCheckJump ( object argument ) : bool

Check to see if the user needs to be alerted that JumpToRecord is not possible.

OnClerkOwningObjChanged ( object sender ) : bool
OnConfigureXmlDocView ( object commandObject ) : bool

Launch the configure dialog.

OnDeleteRecord ( object commandObject ) : bool

If this gets called (which it never should), just say we did it, unless we are in the context of reversal entries. In the case of reversal entries, we say we did not do it, so the record clerk deals with it.

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

The configure dialog may be launched any time this tool is active. Its name is derived from the name of the tool.

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

see if it makes sense to provide the "delete record" command now. Currently we don't support this in document view, except for reversal entries. If we decide to support it, we will need to do additional work (cf LT-1222) to ensure that (a) The clerk's idea of the current entry corresponds to where the selection is (b) After deleting it, the clerk's list gets updated. The former is not happening because we haven't written a SelectionChange method to notice the selection in the view and change the clerk to match. Not sure why the clerk's list isn't being updated...it may be only a problem for homographs.

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

Enables the command that just does Find, without Replace.

OnDisplayLayouts ( object parameter, XCore.UIListDisplayProperties &display ) : bool

Populate the list of layout views for the second dictionary titlebar menu.

OnDisplayPublications ( object parameter, XCore.UIListDisplayProperties &display ) : bool

Populate the list of publications for the first dictionary titlebar menu.

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

Enables the command that just does Find, without Replace.

OnDisplayShowAllEntries ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
OnFindAndReplaceText ( object argument ) : bool

Implements the command that just does Find, without Replace.

OnPropertyChanged ( string name ) : void

Receives the broadcast message "PropertyChanged"

OnRecordNavigation ( object argument ) : bool
OnReplaceText ( object argument ) : bool

Implements the command that just does Find, without Replace.

OnSelectionChanged ( object sender, SIL.FieldWorks.Common.Utils.FwObjectSelectionEventArgs e ) : void

invoked when our XmlDocView selection changes.

OnShowAllEntries ( object args ) : bool
PostLayoutInit ( ) : void

We wait until containing controls are laid out to try to scroll our selection into view, because it depends somewhat on the window being the true size.

PrintFromDetail ( PrintDocument pd, int recordHvo ) : void

Pass command (from RecordEditView) on to printing view.

XmlDocView ( ) : System

Initializes a new instance of the ViewManager class.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

DisposeContextMenu ( object sender, EventArgs e ) : void
GetMessageAdditionalTargets ( List collector ) : void

subclasses should override if they have more targets

InitBase ( XCore.Mediator mediator, XmlNode configurationParameters ) : void

Initialize this as an IxCoreColleague

subclasses must call this from their Init. This was done, rather than providing an Init() here in the normal way, to drive home the point that the subclass must set m_fullyInitialized to true when it is fully initialized.

OnMouseLeave ( EventArgs e ) : void
OnMouseMove ( MouseEventArgs e ) : void
OnPaint ( PaintEventArgs e ) : void

Ensure that we have the current record selected and visible in the window. See LT-9109.

OnParentChanged ( EventArgs e ) : void
OnSizeChanged ( EventArgs e ) : void
ReadParameters ( ) : void

Read in the parameters to determine which sequence/collection we are editing.

RunConfigureDialogAt ( object sender, EventArgs e ) : void
SetInfoBarText ( ) : void
SetupDataContext ( ) : void
SetupStylesheet ( ) : void
ShowRecord ( ) : void
m_contextMenu_Closed ( object sender, System.Windows.Forms.ToolStripDropDownClosedEventArgs e ) : void
m_mainView_MouseClick ( object sender, MouseEventArgs e ) : void
m_mainView_MouseLeave ( object sender, EventArgs e ) : void
m_mainView_MouseMove ( object sender, MouseEventArgs e ) : void

Private Methods

Method Description
AdjustedClerkIndex ( ) : int

By default this returns Clerk.CurrentIndex. However, when we are using a decorator for the view, we may need to adjust the index.

BaseLayoutName ( string name ) : string
DisposeTooltip ( ) : void
ExtractLayoutsFromLayoutTypeList ( IEnumerable layouts ) : string>>.IEnumerable
FindViewNameInList ( string>.IEnumerable layoutList ) : string
GatherBuiltInAndUserLayouts ( ) : string>>.IEnumerable
GetBuiltInLayouts ( XmlNode configNode ) : string>>.IEnumerable
GetPublicationName ( ) : string
GetSafeWsName ( ) : string
GetSelectedConfigView ( ) : string
GetSelectedPublication ( ) : string
GetTarget ( ICmObject obj, int clsid ) : ICmObject
GetUserDefinedDictLayouts ( IEnumerable builtInLayouts, IEnumerable layouts ) : string>>.IEnumerable
GetWidthOfStringInPixels ( string sInput ) : int
GiveSimpleWarning ( ExclusionReasonCode xrc ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

IsCurrentConfigViewChanged ( ) : bool
IsCurrentPublicationChanged ( ) : bool
IsCurrentReversalWsChanged ( ) : bool
IsDesiredPublication ( ICmPossibility item, string name ) : bool
IsObjectVisible ( int hvoTarget, ExclusionReasonCode &xrc ) : bool
MakePublicationTitlePart ( string titleStr ) : string
NoReasonToChangeTitle ( string context ) : bool
OnMouseClick ( MouseEventArgs e ) : void
ResetSpacer ( int spacerWidth, string activeLayoutName ) : void
RunConfigureDialog ( string nodePath ) : void
SelectAndScrollToCurrentRecord ( ) : void
SetConfigViewTitle ( ) : void
SubitemClicked ( Point where, int clsid ) : ICmObject

Return the most specific object identified by a click at the specified position. An object is considered indicated if it is or has an owner of the specified class. The object must be different from the outermost indicated object in the selection.

SubitemClicked ( Point where, int clsid, SimpleRootSite view, SIL.FieldWorks.FDO.FdoCache cache, ISortItemProvider sortItemProvider, IPreferedTargetAdjuster adjuster ) : ICmObject

Return an item of the specified class that is indicated by a click at the specified position, but only if it is part of a different object also of that class.

TrimToMaxPixelWidth ( int pixelWidthAllowed, string sToTrim ) : string
TryToJumpToSelection ( Point where ) : void

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged /// resources; false to release only unmanaged resources. ///
return void

DisposeContextMenu() protected method

protected DisposeContextMenu ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

GetMessageAdditionalTargets() protected method

subclasses should override if they have more targets
protected GetMessageAdditionalTargets ( List collector ) : void
collector List
return void

GetPubDecorator() public method

public GetPubDecorator ( ) : DictionaryPublicationDecorator
return DictionaryPublicationDecorator

Init() public method

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

InitBase() protected method

Initialize this as an IxCoreColleague
subclasses must call this from their Init. This was done, rather than providing an Init() here in the normal way, to drive home the point that the subclass must set m_fullyInitialized to true when it is fully initialized.
protected InitBase ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System.Xml.XmlNode
return void

OnCheckJump() public method

Check to see if the user needs to be alerted that JumpToRecord is not possible.
public OnCheckJump ( object argument ) : bool
argument object the hvo of the record
return bool

OnClerkOwningObjChanged() public method

public OnClerkOwningObjChanged ( object sender ) : bool
sender object
return bool

OnConfigureXmlDocView() public method

Launch the configure dialog.
public OnConfigureXmlDocView ( object commandObject ) : bool
commandObject object
return bool

OnDeleteRecord() public method

If this gets called (which it never should), just say we did it, unless we are in the context of reversal entries. In the case of reversal entries, we say we did not do it, so the record clerk deals with it.
public OnDeleteRecord ( object commandObject ) : bool
commandObject object
return bool

OnDisplayConfigureXmlDocView() public method

The configure dialog may be launched any time this tool is active. Its name is derived from the name of the tool.
public OnDisplayConfigureXmlDocView ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayDeleteRecord() public method

see if it makes sense to provide the "delete record" command now. Currently we don't support this in document view, except for reversal entries. If we decide to support it, we will need to do additional work (cf LT-1222) to ensure that (a) The clerk's idea of the current entry corresponds to where the selection is (b) After deleting it, the clerk's list gets updated. The former is not happening because we haven't written a SelectionChange method to notice the selection in the view and change the clerk to match. Not sure why the clerk's list isn't being updated...it may be only a problem for homographs.
public OnDisplayDeleteRecord ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayFindAndReplaceText() public method

Enables the command that just does Find, without Replace.
public OnDisplayFindAndReplaceText ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayLayouts() public method

Populate the list of layout views for the second dictionary titlebar menu.
public OnDisplayLayouts ( object parameter, XCore.UIListDisplayProperties &display ) : bool
parameter object The parameter.
display XCore.UIListDisplayProperties The display.
return bool

OnDisplayPublications() public method

Populate the list of publications for the first dictionary titlebar menu.
public OnDisplayPublications ( object parameter, XCore.UIListDisplayProperties &display ) : bool
parameter object The parameter.
display XCore.UIListDisplayProperties The display.
return bool

OnDisplayReplaceText() public method

Enables the command that just does Find, without Replace.
public OnDisplayReplaceText ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayShowAllEntries() public method

public OnDisplayShowAllEntries ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnFindAndReplaceText() public method

Implements the command that just does Find, without Replace.
public OnFindAndReplaceText ( object argument ) : bool
argument object
return bool

OnMouseLeave() protected method

protected OnMouseLeave ( EventArgs e ) : void
e System.EventArgs
return void

OnMouseMove() protected method

protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnPaint() protected method

Ensure that we have the current record selected and visible in the window. See LT-9109.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnParentChanged() protected method

protected OnParentChanged ( EventArgs e ) : void
e System.EventArgs
return void

OnPropertyChanged() public method

Receives the broadcast message "PropertyChanged"
public OnPropertyChanged ( string name ) : void
name string
return void

OnRecordNavigation() public method

public OnRecordNavigation ( object argument ) : bool
argument object
return bool

OnReplaceText() public method

Implements the command that just does Find, without Replace.
public OnReplaceText ( object argument ) : bool
argument object
return bool

OnSelectionChanged() public method

invoked when our XmlDocView selection changes.
public OnSelectionChanged ( object sender, SIL.FieldWorks.Common.Utils.FwObjectSelectionEventArgs e ) : void
sender object unused
e SIL.FieldWorks.Common.Utils.FwObjectSelectionEventArgs the event arguments
return void

OnShowAllEntries() public method

public OnShowAllEntries ( object args ) : bool
args object
return bool

OnSizeChanged() protected method

protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

PostLayoutInit() public method

We wait until containing controls are laid out to try to scroll our selection into view, because it depends somewhat on the window being the true size.
public PostLayoutInit ( ) : void
return void

PrintFromDetail() public method

Pass command (from RecordEditView) on to printing view.
public PrintFromDetail ( PrintDocument pd, int recordHvo ) : void
pd PrintDocument PrintDocument
recordHvo int
return void

ReadParameters() protected method

Read in the parameters to determine which sequence/collection we are editing.
protected ReadParameters ( ) : void
return void

RunConfigureDialogAt() protected method

protected RunConfigureDialogAt ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

SetInfoBarText() protected method

protected SetInfoBarText ( ) : void
return void

SetupDataContext() protected method

protected SetupDataContext ( ) : void
return void

SetupStylesheet() protected method

protected SetupStylesheet ( ) : void
return void

ShowRecord() protected method

protected ShowRecord ( ) : void
return void

XmlDocView() public method

Initializes a new instance of the ViewManager class.
public XmlDocView ( ) : System
return System

m_contextMenu_Closed() protected method

protected m_contextMenu_Closed ( object sender, System.Windows.Forms.ToolStripDropDownClosedEventArgs e ) : void
sender object
e System.Windows.Forms.ToolStripDropDownClosedEventArgs
return void

m_mainView_MouseClick() protected method

protected m_mainView_MouseClick ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void

m_mainView_MouseLeave() protected method

protected m_mainView_MouseLeave ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

m_mainView_MouseMove() protected method

protected m_mainView_MouseMove ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void

Property Details

m_configObjectName protected_oe property

protected string m_configObjectName
return string

m_currentIndex protected_oe property

protected int m_currentIndex
return int

m_currentObject protected_oe property

Object currently being edited.
protected ICmObject m_currentObject
return ICmObject

m_hvoOwner protected_oe property

protected int m_hvoOwner
return int

m_mainView protected_oe property

protected XmlSeqView,SIL.FieldWorks.Common.Controls m_mainView
return SIL.FieldWorks.Common.Controls.XmlSeqView