Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions Src/xWorks/DictionaryDetailsView/SenseOptionsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ public string NumberingStyle
{
get
{
// Return null if string is empty, because returning an empty string for reversal numbers
// also forces sense numbers not to be displayed. Null doesn't cause the same problem.
// Handles NumberingStyle for the dictionary/reversal configuration dialog preview display.
// Both empty string and null mean there is no numbering style to use.
// Numbering style will be null if no numbering style has ever been selected.
// Numbering style will be an empty string if a numbering style was selected at some point and then turned back off.
// Returning an empty string for reversal numbering style forces sense numbers to be turned off too, but null doesn't cause this problem.
// Return null if numbering style is empty.
var formatString = ((NumberingStyleComboItem)dropDownNumberingStyle.SelectedItem).FormatString;
return string.IsNullOrEmpty(formatString) ? null : formatString;
}
Expand Down
17 changes: 16 additions & 1 deletion Src/xWorks/DictionaryNodeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,22 @@ public class DictionaryNodeSenseOptions : DictionaryNodeOptions

// Example values: ""->none; %O->1.2.3; %d->1, 2, 3
[XmlAttribute(AttributeName = "numberingStyle")]
public string NumberingStyle { get; set; }
private string _numberingStyle;

public string NumberingStyle
{
get
{
// Handles NumberingStyle for the dictionary and reversal displays.
// Both empty string and null mean there is no numbering style to use.
// Numbering style will be null if no numbering style has ever been selected.
// Numbering style will be an empty string if a numbering style was selected at some point and then turned back off.
// Returning an empty string for reversal numbering style forces sense numbers to be turned off too, but null doesn't cause this problem.
// Return null if numbering style is empty.
return string.IsNullOrEmpty(_numberingStyle)? null : _numberingStyle;
}
set { _numberingStyle = value; }
}

// Example values: ""->none; %j->Joined; %.->Separated by dot
[XmlAttribute(AttributeName = "parentSenseNumberingStyle")]
Expand Down
Loading