C# Class SIL.FieldWorks.Common.Controls.XmlBrowseViewBase

Inheritance: SIL.FieldWorks.Common.RootSites.RootSite, IVwNotifyChange
显示文件 Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_bv BrowseViewer
m_dyTopOfScreenOffset int
m_fHandlingMouseUp bool
m_fMouseUpEnabled bool
m_fSelectedRowHighlighting SelectionHighlighting
m_fakeFlid int
m_hvoOldSel int
m_hvoRoot int
m_iSelIndex int
m_iTopOfScreenObjectForScrollPosition int
m_id string
m_nodeSpec System.Xml.XmlNode
m_rootObjectHasBeenSet bool
m_sda ISilDataAccessManaged
m_selectedIndex int
m_sortItemProvider ISortItemProvider
m_stringTable SIL.Utils.StringTable
m_tagMe int
m_wantScrollIntoView bool
m_xbvvc SIL.FieldWorks.Common.Controls.XmlBrowseViewBaseVc
m_ydSelBottom int
m_ydSelScrollPos int
m_ydSelTop int

Private Properties

Property Type Description
DoMouseWheelVScroll bool
DoSelectionSideEffects void
FireSelectionChanged bool
GetCurrentTableCellInfo void
GetNewSelectionObject int
GetRowIndexFromSelection int
GetStringList string[]
InitializeComponent void
LocationOfSelectedRow System.Drawing.Rectangle
MakeSelectionAt IVwSelection
RemoveRootBoxSelectionOnIdle bool
RestoreScrollPosition bool
SetDefaultInsertionPointInRow bool
SetSelectedIndex void
ShouldConvertDummiesInView bool
UpdateSelectedRow bool

Public Methods

Method Description
ClearValues ( ) : void

Clear dangerous data values out of any of your decorated SDAs that require it.

ColumnSortedFromEnd ( int icol ) : bool

a look up table for getting the correct version of strings that the user will see.

GetColWidthInfo ( ) : VwLength[]

Get the widths of the columns as VwLengths (for the view tables).

GetCorrespondingPropertyName ( string property ) : string

Gets the name of the corresponding property.

HvoAt ( int index ) : int

Get the HVO of the object at the specified index.

Init ( XCore mediator, System configurationParameters ) : void

Allows xCore-specific initialization. We don't need any.

Init ( XmlNode nodeSpec, int hvoRoot, int fakeFlid, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, BrowseViewer bv ) : void

Inits the specified node spec.

MakeRoot ( ) : void

Make the root box.

OnDeleteRecord ( object commandObject ) : bool

Called when [delete record].

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

see if it makes sense to provide the "delete record" command now

OnExportText ( object args ) : bool

Export the contents of the browse view to the debug window. Answer false so other browse views can export theirs also.

OnPasteFixTssEvent ( EditingHelper sender, FwPasteFixTssEventArgs e ) : void

If the text for pasting is too long, truncate it and warn the user.

OnPrepareToRefresh ( object args ) : bool

Called when [prepare to refresh].

OnPrint ( object args ) : bool

Tries to be smart about whether our RootSite should print or not.

OnRequestDebugInfo ( object commandObj ) : bool

Called when [request debug info].

OnRestoreScrollPosition ( object args ) : bool

Called through mediator by reflection. (Maybe?) This routine attempts to restore the scroll position previously saved by OnSaveScrollPosition. Specifically, it attempts to scroll to a position such that the top of the object at index m_iTopOfScreenObjectForScrollPosition is m_dyTopOfScreenOffset pixels below the top of the client area (or above, if m_dyTopOfScreenOffset is negative).

OnSaveScrollPosition ( object args ) : bool

Called through mediator by reflection. Save the current scroll position for later restoration, in a form that will survive having the view contents replaced by a lazy box (that is, it's not good enough to just save AutoScrollPosition.y, we need enough information to create a selection at the top of the screen and get a corresponding selection back there. This class implements this by figuring out the index of the record at the top of the screen and saving that.

PostLayoutInit ( ) : void

After we have our true size, make sure the interesting row is visible.

PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void

RefreshDisplay ( ) : bool

SetScrollBarParameters ( ScrollBar scrollBar ) : void

Set a controlling scrollbar's parameters using information this object owns.

SetSelectedRowHighlighting ( ) : void

Cause the behavior to switch to the current setting of ReadOnlyBrowse. Override if the behaivor should be different than this.

XmlBrowseViewBase ( ) : System

Initializes a new instance of the T:XmlBrowseViewBase class.

Protected Methods

Method Description
AdjustScrollRange1 ( int dxdSize, int dxdPosition, int dydSize, int dydPosition ) : bool

Handle the special aspects of adjusting the scroll position for a table of cells like we have in the browse view. See LT-3607 for details of what can go wrong without this override.

CreateSelectionRestorer ( ) : SIL.FieldWorks.Common.RootSites.SelectionRestorer

Creates a new selection restorer.

Dispose ( bool disposing ) : void

Clean up any resources being used.

DoSelectAndScroll ( int hvo, int index ) : void

Does the select and scroll.

DoSelectionSideEffects ( IVwSelection sel ) : void

Common code to HandleSelectionChange and MouseDown.

EnsureDefaultSelection ( ) : void

A browse view does not HAVE to have a selection; forcing one (e.g., after clicking on a check box) and scrolling to the one we made at the start of the view is very disconcerting.

GetRowSelection ( int index ) : IVwSelection

Gets the row selection.

HandleSelectionChange ( IVwRootBox prootb, IVwSelection vwselNew ) : void

Notifies us that the selection changed. When next idle, we want to delete any unhelpful selection.

OnGotFocus ( EventArgs e ) : void

Because this is a simple root site, which is derived from UserControl, we can't prevent MouseDown from giving it focus. But we can give other linked windows a chance to take it back.

OnKeyDown ( KeyEventArgs e ) : void

Handle the OnKeyDown event

OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void

Overridden to fix TE-4146

OnMouseDown ( MouseEventArgs e ) : void

MouseUp actions on XmlBrowseView should only be enabled if a preceeding MouseDown occured in the view.

OnMouseUp ( MouseEventArgs e ) : void

Process left or right mouse button down

OnMouseWheel ( MouseEventArgs e ) : void

When we get a mouse wheel event for windows other than the scrolling controller then pass on the message to the scrolling controller.

OnPaint ( PaintEventArgs e ) : void

Call Draw() which does all the real painting

SaveSelectionInfo ( Rectangle rcIdeal, int ydTop ) : void

Save the location information for the current selection being made visible.

SelectContentsOfCell ( IVwSelection vwsel ) : void

Private Methods

Method Description
DoMouseWheelVScroll ( MouseEventArgs e ) : bool
DoSelectionSideEffects ( MouseEventArgs e ) : void
FireSelectionChanged ( object parameter ) : bool
GetCurrentTableCellInfo ( IVwSelection vwsel, int &iLevel, int &iBox, int &iTableBox, int &cTableBoxes, int &iTableLevel, int &iCellBox, int &cCellBoxes, int &iCellLevel ) : void

Gets the row/cell information of the current selection.

GetNewSelectionObject ( int index ) : int

Convert the new selection into a real object before making any selection. Otherwise the views code might convert it during the selection, making the selection invalid.

GetRowIndexFromSelection ( IVwSelection sel, bool fEndPoint ) : int

Given a selection in the view, return the row index. Rarely may return -1 if unable to identify a row.

GetStringList ( XmlNode spec ) : string[]

Get from the specified node a list of strings, as used in filter bar and bulk edit bar, where the node is expected to have a [stringList] first child element which is interpreted in the context of our string table.

InitializeComponent ( ) : void

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

LocationOfSelectedRow ( ) : Rectangle
MakeSelectionAt ( MouseEventArgs e ) : IVwSelection

Make the selection that would be made by clicking at the specified mouse event, but don't install it.

RemoveRootBoxSelectionOnIdle ( object parameter ) : bool
RestoreScrollPosition ( int irow ) : bool

Called by BulkEditBar if Preview makes the highlighted row scroll off the screen. It attempts to scroll to a position such that the top of the object at index irow is m_dyTopOfScreenOffset pixels below the top of the client area (or above, if m_dyTopOfScreenOffset is negative).

SetDefaultInsertionPointInRow ( int index ) : bool

Set an insertion point somewhere in the given row, and install the selection if it exists.

SetSelectedIndex ( int ihvo ) : void
ShouldConvertDummiesInView ( ) : bool

read configuration for the browse view to determine whether to try to convert dummy objects to real objects when as they become painted on the screen. (Default is false)

UpdateSelectedRow ( object args ) : bool

Method Details

AdjustScrollRange1() protected method

Handle the special aspects of adjusting the scroll position for a table of cells like we have in the browse view. See LT-3607 for details of what can go wrong without this override.
protected AdjustScrollRange1 ( int dxdSize, int dxdPosition, int dydSize, int dydPosition ) : bool
dxdSize int change in the horizontal size
dxdPosition int horizontal position where change occurred
dydSize int change in the vertical size
dydPosition int vertical position where change occurred
return bool

ClearValues() public method

Clear dangerous data values out of any of your decorated SDAs that require it.
public ClearValues ( ) : void
return void

ColumnSortedFromEnd() public method

a look up table for getting the correct version of strings that the user will see.
public ColumnSortedFromEnd ( int icol ) : bool
icol int
return bool

CreateSelectionRestorer() protected method

Creates a new selection restorer.
protected CreateSelectionRestorer ( ) : SIL.FieldWorks.Common.RootSites.SelectionRestorer
return SIL.FieldWorks.Common.RootSites.SelectionRestorer

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
return void

DoSelectAndScroll() protected method

Does the select and scroll.
protected DoSelectAndScroll ( int hvo, int index ) : void
hvo int The hvo.
index int The index.
return void

DoSelectionSideEffects() protected method

Common code to HandleSelectionChange and MouseDown.
protected DoSelectionSideEffects ( IVwSelection sel ) : void
sel IVwSelection
return void

EnsureDefaultSelection() protected method

A browse view does not HAVE to have a selection; forcing one (e.g., after clicking on a check box) and scrolling to the one we made at the start of the view is very disconcerting.
protected EnsureDefaultSelection ( ) : void
return void

GetColWidthInfo() public method

Get the widths of the columns as VwLengths (for the view tables).
public GetColWidthInfo ( ) : VwLength[]
return VwLength[]

GetCorrespondingPropertyName() public method

Gets the name of the corresponding property.
public GetCorrespondingPropertyName ( string property ) : string
property string The property.
return string

GetRowSelection() protected method

Gets the row selection.
protected GetRowSelection ( int index ) : IVwSelection
index int The index.
return IVwSelection

HandleSelectionChange() protected method

Notifies us that the selection changed. When next idle, we want to delete any unhelpful selection.
protected HandleSelectionChange ( IVwRootBox prootb, IVwSelection vwselNew ) : void
prootb IVwRootBox
vwselNew IVwSelection
return void

HvoAt() public method

Get the HVO of the object at the specified index.
public HvoAt ( int index ) : int
index int
return int

Init() public method

Allows xCore-specific initialization. We don't need any.
public Init ( XCore mediator, System configurationParameters ) : void
mediator XCore
configurationParameters System
return void

Init() public method

Inits the specified node spec.
public Init ( XmlNode nodeSpec, int hvoRoot, int fakeFlid, SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, BrowseViewer bv ) : void
nodeSpec System.Xml.XmlNode The node spec.
hvoRoot int The hvo root.
fakeFlid int The fake flid.
cache SIL.FieldWorks.FDO.FdoCache The cache.
mediator XCore.Mediator The mediator.
bv BrowseViewer The bv. Also used to set SortItemProvider
return void

MakeRoot() public method

Make the root box.
public MakeRoot ( ) : void
return void

OnDeleteRecord() public method

Called when [delete record].
public OnDeleteRecord ( object commandObject ) : bool
commandObject object The command object.
return bool

OnDisplayDeleteRecord() public method

see if it makes sense to provide the "delete record" command now
public OnDisplayDeleteRecord ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnExportText() public method

Export the contents of the browse view to the debug window. Answer false so other browse views can export theirs also.
public OnExportText ( object args ) : bool
args object
return bool

OnGotFocus() protected method

Because this is a simple root site, which is derived from UserControl, we can't prevent MouseDown from giving it focus. But we can give other linked windows a chance to take it back.
protected OnGotFocus ( EventArgs e ) : void
e System.EventArgs
return void

OnKeyDown() protected method

Handle the OnKeyDown event
protected OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void

OnLayout() protected method

Overridden to fix TE-4146
protected OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void
levent System.Windows.Forms.LayoutEventArgs
return void

OnMouseDown() protected method

MouseUp actions on XmlBrowseView should only be enabled if a preceeding MouseDown occured in the view.
protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnMouseUp() protected method

Process left or right mouse button down
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnMouseWheel() protected method

When we get a mouse wheel event for windows other than the scrolling controller then pass on the message to the scrolling controller.
protected OnMouseWheel ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnPaint() protected method

Call Draw() which does all the real painting
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnPasteFixTssEvent() public method

If the text for pasting is too long, truncate it and warn the user.
public OnPasteFixTssEvent ( EditingHelper sender, FwPasteFixTssEventArgs e ) : void
sender EditingHelper
e FwPasteFixTssEventArgs
return void

OnPrepareToRefresh() public method

Called when [prepare to refresh].
public OnPrepareToRefresh ( object args ) : bool
args object The args.
return bool

OnPrint() public method

Tries to be smart about whether our RootSite should print or not.
public OnPrint ( object args ) : bool
args object
return bool

OnRequestDebugInfo() public method

Called when [request debug info].
public OnRequestDebugInfo ( object commandObj ) : bool
commandObj object The command obj.
return bool

OnRestoreScrollPosition() public method

Called through mediator by reflection. (Maybe?) This routine attempts to restore the scroll position previously saved by OnSaveScrollPosition. Specifically, it attempts to scroll to a position such that the top of the object at index m_iTopOfScreenObjectForScrollPosition is m_dyTopOfScreenOffset pixels below the top of the client area (or above, if m_dyTopOfScreenOffset is negative).
public OnRestoreScrollPosition ( object args ) : bool
args object
return bool

OnSaveScrollPosition() public method

Called through mediator by reflection. Save the current scroll position for later restoration, in a form that will survive having the view contents replaced by a lazy box (that is, it's not good enough to just save AutoScrollPosition.y, we need enough information to create a selection at the top of the screen and get a corresponding selection back there. This class implements this by figuring out the index of the record at the top of the screen and saving that.
public OnSaveScrollPosition ( object args ) : bool
args object
return bool

PostLayoutInit() public method

After we have our true size, make sure the interesting row is visible.
public PostLayoutInit ( ) : void
return void

PropChanged() public method

public PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void
hvo int
tag int
ivMin int
cvIns int
cvDel int
return void

RefreshDisplay() public method

public RefreshDisplay ( ) : bool
return bool

SaveSelectionInfo() protected method

Save the location information for the current selection being made visible.
protected SaveSelectionInfo ( Rectangle rcIdeal, int ydTop ) : void
rcIdeal System.Drawing.Rectangle rectangle of selection
ydTop int current scroll position
return void

SelectContentsOfCell() protected method

protected SelectContentsOfCell ( IVwSelection vwsel ) : void
vwsel IVwSelection
return void

SetScrollBarParameters() public method

Set a controlling scrollbar's parameters using information this object owns.
public SetScrollBarParameters ( ScrollBar scrollBar ) : void
scrollBar System.Windows.Forms.ScrollBar
return void

SetSelectedRowHighlighting() public method

Cause the behavior to switch to the current setting of ReadOnlyBrowse. Override if the behaivor should be different than this.
public SetSelectedRowHighlighting ( ) : void
return void

XmlBrowseViewBase() public method

Initializes a new instance of the T:XmlBrowseViewBase class.
public XmlBrowseViewBase ( ) : System
return System

Property Details

m_bv protected_oe property

protected BrowseViewer m_bv
return BrowseViewer

m_dyTopOfScreenOffset protected_oe property

protected int m_dyTopOfScreenOffset
return int

m_fHandlingMouseUp protected_oe property

protected bool m_fHandlingMouseUp
return bool

m_fMouseUpEnabled protected_oe property

We only want to do something on mouse up events if the XmlBrowseView has gotten a mouseDown event.
protected bool m_fMouseUpEnabled
return bool

m_fSelectedRowHighlighting protected_oe property

protected SelectionHighlighting m_fSelectedRowHighlighting
return SelectionHighlighting

m_fakeFlid protected_oe property

protected int m_fakeFlid
return int

m_hvoOldSel protected_oe property

protected int m_hvoOldSel
return int

m_hvoRoot protected_oe property

protected int m_hvoRoot
return int

m_iSelIndex protected_oe property

protected int m_iSelIndex
return int

m_iTopOfScreenObjectForScrollPosition protected_oe property

protected int m_iTopOfScreenObjectForScrollPosition
return int

m_id protected_oe property

protected string m_id
return string

m_nodeSpec protected_oe property

protected XmlNode,System.Xml m_nodeSpec
return System.Xml.XmlNode

m_rootObjectHasBeenSet protected_oe property

protected bool m_rootObjectHasBeenSet
return bool

m_sda protected_oe property

the sda in which looking up m_fakeFlid as a property of m_hvoRoot works.
protected ISilDataAccessManaged m_sda
return ISilDataAccessManaged

m_selectedIndex protected_oe property

protected int m_selectedIndex
return int

m_sortItemProvider protected_oe property

record list supplying browse view content
protected ISortItemProvider m_sortItemProvider
return ISortItemProvider

m_stringTable protected_oe property

protected StringTable,SIL.Utils m_stringTable
return SIL.Utils.StringTable

m_tagMe protected_oe property

protected int m_tagMe
return int

m_wantScrollIntoView protected_oe property

protected bool m_wantScrollIntoView
return bool

m_xbvvc protected_oe property

protected XmlBrowseViewBaseVc,SIL.FieldWorks.Common.Controls m_xbvvc
return SIL.FieldWorks.Common.Controls.XmlBrowseViewBaseVc

m_ydSelBottom protected_oe property

protected int m_ydSelBottom
return int

m_ydSelScrollPos protected_oe property

protected int m_ydSelScrollPos
return int

m_ydSelTop protected_oe property

protected int m_ydSelTop
return int