C# Class SIL.FieldWorks.Discourse.DiscourseExporter

DiscourseExporter is an IVwEnv implementation which exports discourse data to an XmlWriter. Make one of these by creating an XmlTextWriter. Refactoring is probably in order to share more code with InterlinearExporter, or move common code down to CollectorEnv. This has been postponed in the interests of being able to release FW 5.2.1 without requiring changes to DLLs other than Discourse.
Inheritance: SIL.FieldWorks.Common.RootSites.CollectorEnv, IDisposable
Datei anzeigen Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
GetText string
GetWsFromTsString int
MarkNeedsSpace void
UpdateWsList void
WriteLangAndContent void
WriteLanguages void
WriteMTMarker void
WriteStringProp void
WriteStringProp void
WriteStringVal void
WriteWordForm void

Public Methods

Method Description
AddObj ( int hvoItem, IVwViewConstructor vc, int frag ) : void
AddObjProp ( int tag, IVwViewConstructor vc, int frag ) : void
AddObjVecItems ( int tag, IVwViewConstructor vc, int frag ) : void

overridden to maintain the frags array.

AddString ( ITsString tss ) : void
AddStringAltMember ( int tag, int ws, IVwViewConstructor _vwvc ) : void
AddStringProp ( int tag, IVwViewConstructor _vwvc ) : void
CloseTableCell ( ) : void
DiscourseExporter ( SIL.FieldWorks.FDO.FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc, int wsLineNumber ) : System
Dispose ( ) : void
ExportDisplay ( ) : void
OpenTableCell ( int nRowSpan, int nColSpan ) : void

Here we build the main structure of the chart as a collection of cells. We have to be a bit tricky about generating the header.

set_IntProperty ( int tpt, int tpv, int nValue ) : void

Protected Methods

Method Description
CloseTheObject ( ) : void
Dispose ( bool fDisposing ) : void
OpenTheObject ( int hvo, int ihvo ) : void

Called whenever we start the display of an object, we currently use it to catch the start of a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to minimize changes to other DLLs, and those routines are not currently virtual in the base class.

Private Methods

Method Description
GetText ( ITsString tss ) : string
GetWsFromTsString ( ITsString tss ) : int
MarkNeedsSpace ( string lit ) : void

Add attributes to an element just started to indicate whether white space is needed before or after the specified literal. The current implementation is simplistic, based on the few separators actually used in the discourse chart. The default is nothing added, indicating that white space IS needed.

UpdateWsList ( int ws ) : void
WriteLangAndContent ( int ws1, ITsString tss ) : void

Write a lang attribute identifying the string, then its content as the body of an element.

WriteLanguages ( ) : void

Write out the languages element. This should be used in InterlinearExporter, too.

WriteMTMarker ( ITsString tss ) : void
WriteStringProp ( int tag, string elementTag, int alt ) : void
WriteStringProp ( int tag, string elementTag, int alt, string extraAttr, string extraAttrVal ) : void
WriteStringVal ( string elementTag, int ws, ITsString tss, string extraAttr, string extraAttrVal ) : void
WriteWordForm ( string elementTag, ITsString tss, int ws, string extraAttr ) : void

Method Details

AddObj() public method

public AddObj ( int hvoItem, IVwViewConstructor vc, int frag ) : void
hvoItem int
vc IVwViewConstructor
frag int
return void

AddObjProp() public method

public AddObjProp ( int tag, IVwViewConstructor vc, int frag ) : void
tag int
vc IVwViewConstructor
frag int
return void

AddObjVecItems() public method

overridden to maintain the frags array.
public AddObjVecItems ( int tag, IVwViewConstructor vc, int frag ) : void
tag int
vc IVwViewConstructor
frag int
return void

AddString() public method

public AddString ( ITsString tss ) : void
tss ITsString
return void

AddStringAltMember() public method

public AddStringAltMember ( int tag, int ws, IVwViewConstructor _vwvc ) : void
tag int
ws int
_vwvc IVwViewConstructor
return void

AddStringProp() public method

public AddStringProp ( int tag, IVwViewConstructor _vwvc ) : void
tag int
_vwvc IVwViewConstructor
return void

CloseTableCell() public method

public CloseTableCell ( ) : void
return void

CloseTheObject() protected method

protected CloseTheObject ( ) : void
return void

DiscourseExporter() public method

public DiscourseExporter ( SIL.FieldWorks.FDO.FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc, int wsLineNumber ) : System
cache SIL.FieldWorks.FDO.FdoCache
writer System.Xml.XmlWriter
hvoRoot int
vc IVwViewConstructor
wsLineNumber int
return System

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool fDisposing ) : void
fDisposing bool
return void

ExportDisplay() public method

public ExportDisplay ( ) : void
return void

OpenTableCell() public method

Here we build the main structure of the chart as a collection of cells. We have to be a bit tricky about generating the header.
public OpenTableCell ( int nRowSpan, int nColSpan ) : void
nRowSpan int
nColSpan int
return void

OpenTheObject() protected method

Called whenever we start the display of an object, we currently use it to catch the start of a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to minimize changes to other DLLs, and those routines are not currently virtual in the base class.
protected OpenTheObject ( int hvo, int ihvo ) : void
hvo int
ihvo int
return void

set_IntProperty() public method

public set_IntProperty ( int tpt, int tpv, int nValue ) : void
tpt int
tpv int
nValue int
return void