Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/SIL.LCModel/DomainImpl/OverridesLing_Lex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10065,5 +10065,39 @@ public ILcmReferenceSequence<ICmPossibility> DialectLabelsRS
return sense.DialectLabelsSenseOrEntry;
}
}

/// <summary>
/// There are some special cases where the value of a field cannot be obtained
/// by getting the value of fieldName on the SenseOrEntry.Item. This method accounts for
/// those special cases and returns the Item and fieldName that will need to be used to
/// get the value. If it is not a special case then the default is to return SenseOrEntry.Item
/// for specificItem and return fieldName for specificFieldName.
/// </summary>
/// <param name="fieldName">The general fieldName associated with this SenseOrEntry object.</param>
/// <param name="specificItem">The specific LexSense or LexEntry item that will contain a
/// value for specificFieldName.</param>
/// <param name="specificFieldName">The specific field name that will need to be used to get
/// the value from the specificItem.</param>
public void SpecificItemAndFieldName(string fieldName, out ICmObject specificObject, out string specificFieldName)
{
specificObject = Item;
specificFieldName = fieldName;
if (fieldName == "HeadWordRef")
{
var sense = Item as ILexSense;
if (sense != null)
{
specificFieldName = "MLOwnerOutlineName";
}
}
else if (fieldName == "EntryRefsOS")
{
var sense = Item as ILexSense;
if (sense != null)
{
specificObject = sense.Entry;
}
}
}
}
}
15 changes: 15 additions & 0 deletions src/SIL.LCModel/InterfaceAdditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5992,5 +5992,20 @@ public interface ISenseOrEntry
/// Returns the dialect labels for the entry or sense
/// </summary>
ILcmReferenceSequence<ICmPossibility> DialectLabelsRS { get; }

/// <summary>
/// There are some special cases where the value of a field cannot be obtained
/// by getting the value of fieldName on the SenseOrEntry.Item. This method accounts for
/// those special cases and returns the Item and fieldName that will need to be used to
/// get the value. If it is not a special case then the default is to return SenseOrEntry.Item
/// for specificItem and return fieldName for specificFieldName.
/// </summary>
/// <param name="fieldName">The general fieldName associated with this SenseOrEntry object.</param>
/// <param name="specificItem">The specific LexSense or LexEntry item that will contain a
/// value for specificFieldName.</param>
/// <param name="specificFieldName">The specific field name that will need to be used to get
/// the value from the specificItem.</param>
void SpecificItemAndFieldName(string fieldName, out ICmObject specificItem, out string specificFieldName);

}
}
Loading