private void HighlightUsages_CheckedChanged(object sender, EventArgs e) { WordHelpers.RunActionWithWaitCursor(() => { ResetTheCounters(); var isFieldChecked = HighlightAllUsages.Checked; if (isFieldChecked) { if (_corectDefinitionOccurences.Count != 0) { HighLightCorrectUsages(); NextDefinition.Enabled = true; } else { if (HighlightIncorrectUsages.Checked && _incorrectDefinitionOccurences.Count != 0) { NextDefinition.Enabled = true; } } return; } if (!HighlightIncorrectUsages.Checked) { NextDefinition.Enabled = false; PreviousDefiniton.Enabled = false; } DocumentHelpers.ClearHightlightOnAllInstancesOfTerm(_corectDefinitionOccurences); }); }
private void DefinitionBox_FormClosing(object sender, FormClosingEventArgs e) { ThisAddIn.DecreaseDialogCoords(); WordHelpers.RunActionWithWaitCursor(() => { if (HighlightAllUsages.Checked) { if (_corectDefinitionOccurences.Count != 0) { DocumentHelpers.ClearHightlightOnAllInstancesOfTerm(_corectDefinitionOccurences); } } if (HighlightIncorrectUsages.Checked) { if (_incorrectDefinitionOccurences.Count != 0) { DocumentHelpers.ClearHightlightOnAllInstancesOfTerm(_incorrectDefinitionOccurences); } } if (_currentPosition != null) { Navigate.ToRange(_currentPosition); } }); }
private void HighlightIncorrectUsages_CheckedChanged(object sender, EventArgs e) { ResetTheCounters(); var isFieldChecked = HighlightIncorrectUsages.Checked; if (isFieldChecked) { LogHelper.Info("Highlight incorrect usages of definition."); if (_incorrectDefinitionOccurences.Count != 0) { HighLightIncorrectUsages(); NextDefinition.Enabled = true; } else { if (HighlightAllUsages.Checked && _corectDefinitionOccurences.Count != 0) { NextDefinition.Enabled = true; } } return; } if (!HighlightAllUsages.Checked) { NextDefinition.Enabled = false; PreviousDefiniton.Enabled = false; } LogHelper.Info("Clear highlights."); DocumentHelpers.ClearHightlightOnAllInstancesOfTerm(_incorrectDefinitionOccurences); }