C# Class SIL.FieldWorks.XWorks.ConcDecorator

This class exists to decorate the main SDA for concordance views and browse views that show occurrence counts. It implements the Occurrences and OccurrencesCount properties for WfiWordform, WfiAnalysis, and/or WfiGloss. Both occurrences and OccurrencesCount are decorator rather than virtual properties because the results depend on per-window choices of which texts to include. It also implements the property ConcOccurrences, which is a decorator-only object as well as a decorator-only property. ConcOccurrences is the top-level list of occurrences of whatever the user asked to search for in Concordance view. Occurrences are 'fake' HVOs that don't correspond to any real object in the database. They also have properties only recognized by the decorator, such as a reference, begin and end character offsets (in the original paragraph string...used to bold the keyword), the object (typically StTxtPara) and segment they belong to, and several other derived properties which can be displayed in optional columns of the concordance views.
Inheritance: SIL.FieldWorks.FDO.Application.DomainDataByFlidDecoratorBase, IAnalysisOccurrenceFromHvo, ISetMediator, IRefreshCache
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
AddNotification ( IVwNotifyChange nchng ) : void

Count the things that are interested in us so that, when there are no more, we can indicate that we no longer care about changes to the collection of interesting texts. Review JohnT: could it ever happen that we regain our interest in those changes, getting a new notifiee after we lost our last one?

ConcDecorator ( ISilDataAccessManaged domainDataByFlid, XmlNode configurationNode, IFdoServiceLocator services ) : System
IsInterestingText ( IStText text ) : bool

Makes more acessible the means of testing for interesting texts.

OccurrenceFromHvo ( int hvo ) : IParaFragment

Makes the actual analysis occurrence available (e.g., for configuring the appropriate interlinear view).

OnItemDataModified ( object argument ) : void

This is invoked by reflection when the Respeller dialog changes the frequency of a wordform.

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

Refresh your cached properties.

RemoveNotification ( IVwNotifyChange nchng ) : void
ResumeRefresh ( ) : void
SetMediator ( Mediator mediator ) : void
SetOccurrences ( int hvo, IEnumerable occurrences ) : void

This is used by the ConcordanceControl (in ITextDll), which in various ways comes up with a list of occurrences to display in a concordance browse view. Often the occurrences made in this way do not have a meaningful Index, but we are not using that here. We make a dummy HVO for the root as well as the items, if we don't already have one.

SuspendRefresh ( ) : void
UpdateAnalysisOccurrences ( IAnalysis obj, bool includeChildren ) : void
UpdateExactAnalysisOccurrences ( IAnalysis obj ) : void

Make sure we have the right list of occurrences for the specified analysis (assumes we are using ExactOccurrences).

UpdateOccurrences ( int values ) : void

Update the occurrences list (kflidConcOccurrences of LangProject) to the specified array, without sending PropChanged. (Typically used during ReloadList.)

VecProp ( int hvo, int tag ) : int[]
get_BooleanProp ( int hvo, int tag ) : bool
get_IntProp ( int hvo, int tag ) : int
get_MultiStringAlt ( int hvo, int tag, int ws ) : ITsString
get_ObjectProp ( int hvo, int tag ) : int
get_StringProp ( int hvo, int tag ) : ITsString
get_VecItem ( int hvo, int tag, int index ) : int
get_VecSize ( int hvo, int tag ) : int

Protected Methods

Method Description
AddAdditionalOccurrences ( int hvoWf, IParaFragment>.Dictionary occurrences, int &nextId, List valuesList ) : void

Overridden in RespellingSda to add caption occurrences.

ReplaceAnalysisOccurrences ( int hvo, int values ) : void

Replace the occurrence values for a WfiWordform. Assume that all of the values are already registered in m_occurrences through previous calls to GetAnalysisOccurrences().

This is used by the Respelling subclass of this decorator.

Private Methods

Method Description
BelongsToInterestingText ( ISegment seg ) : bool
EmptyUserString ( ) : ITsString
GetAnalysisOccurrences ( int hvo ) : int[]
GetAnalysisOccurrences ( int hvo, bool includeChildren ) : int[]

Get the occurrences of a particular analysis in the currently interesting texts.

GetSenseOccurrences ( int hvo ) : int[]

Get the values we want for the occurrences of the specified LexSE HVO.

GetStText ( int hvoOccurrence ) : IStText
m_interestingTexts_InterestingTextsChanged ( object sender, InterestingTextsChangedArgs e ) : void

Method Details

AddAdditionalOccurrences() protected method

Overridden in RespellingSda to add caption occurrences.
protected AddAdditionalOccurrences ( int hvoWf, IParaFragment>.Dictionary occurrences, int &nextId, List valuesList ) : void
hvoWf int
occurrences IParaFragment>.Dictionary
nextId int
valuesList List
return void

AddNotification() public method

Count the things that are interested in us so that, when there are no more, we can indicate that we no longer care about changes to the collection of interesting texts. Review JohnT: could it ever happen that we regain our interest in those changes, getting a new notifiee after we lost our last one?
public AddNotification ( IVwNotifyChange nchng ) : void
nchng IVwNotifyChange
return void

ConcDecorator() public method

public ConcDecorator ( ISilDataAccessManaged domainDataByFlid, XmlNode configurationNode, IFdoServiceLocator services ) : System
domainDataByFlid ISilDataAccessManaged
configurationNode System.Xml.XmlNode
services IFdoServiceLocator
return System

IsInterestingText() public method

Makes more acessible the means of testing for interesting texts.
public IsInterestingText ( IStText text ) : bool
text IStText
return bool

OccurrenceFromHvo() public method

Makes the actual analysis occurrence available (e.g., for configuring the appropriate interlinear view).
public OccurrenceFromHvo ( int hvo ) : IParaFragment
hvo int
return IParaFragment

OnItemDataModified() public method

This is invoked by reflection when the Respeller dialog changes the frequency of a wordform.
public OnItemDataModified ( object argument ) : void
argument object
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

Refresh() public method

Refresh your cached properties.
public Refresh ( ) : void
return void

RemoveNotification() public method

public RemoveNotification ( IVwNotifyChange nchng ) : void
nchng IVwNotifyChange
return void

ReplaceAnalysisOccurrences() protected method

Replace the occurrence values for a WfiWordform. Assume that all of the values are already registered in m_occurrences through previous calls to GetAnalysisOccurrences().
This is used by the Respelling subclass of this decorator.
protected ReplaceAnalysisOccurrences ( int hvo, int values ) : void
hvo int
values int
return void

ResumeRefresh() public method

public ResumeRefresh ( ) : void
return void

SetMediator() public method

public SetMediator ( Mediator mediator ) : void
mediator Mediator
return void

SetOccurrences() public method

This is used by the ConcordanceControl (in ITextDll), which in various ways comes up with a list of occurrences to display in a concordance browse view. Often the occurrences made in this way do not have a meaningful Index, but we are not using that here. We make a dummy HVO for the root as well as the items, if we don't already have one.
public SetOccurrences ( int hvo, IEnumerable occurrences ) : void
hvo int
occurrences IEnumerable
return void

SuspendRefresh() public method

public SuspendRefresh ( ) : void
return void

UpdateAnalysisOccurrences() public method

public UpdateAnalysisOccurrences ( IAnalysis obj, bool includeChildren ) : void
obj IAnalysis
includeChildren bool
return void

UpdateExactAnalysisOccurrences() public method

Make sure we have the right list of occurrences for the specified analysis (assumes we are using ExactOccurrences).
public UpdateExactAnalysisOccurrences ( IAnalysis obj ) : void
obj IAnalysis
return void

UpdateOccurrences() public method

Update the occurrences list (kflidConcOccurrences of LangProject) to the specified array, without sending PropChanged. (Typically used during ReloadList.)
public UpdateOccurrences ( int values ) : void
values int
return void

VecProp() public method

public VecProp ( int hvo, int tag ) : int[]
hvo int
tag int
return int[]

get_BooleanProp() public method

public get_BooleanProp ( int hvo, int tag ) : bool
hvo int
tag int
return bool

get_IntProp() public method

public get_IntProp ( int hvo, int tag ) : int
hvo int
tag int
return int

get_MultiStringAlt() public method

public get_MultiStringAlt ( int hvo, int tag, int ws ) : ITsString
hvo int
tag int
ws int
return ITsString

get_ObjectProp() public method

public get_ObjectProp ( int hvo, int tag ) : int
hvo int
tag int
return int

get_StringProp() public method

public get_StringProp ( int hvo, int tag ) : ITsString
hvo int
tag int
return ITsString

get_VecItem() public method

public get_VecItem ( int hvo, int tag, int index ) : int
hvo int
tag int
index int
return int

get_VecSize() public method

public get_VecSize ( int hvo, int tag ) : int
hvo int
tag int
return int