phdesign.NppToolBucket.FindAndReplace.SaveReplaceHistory C# (CSharp) Method

SaveReplaceHistory() private method

private SaveReplaceHistory ( string replaceText ) : bool
replaceText string
return bool
        private bool SaveReplaceHistory(string replaceText)
        {
            if (string.IsNullOrEmpty(replaceText)) return false;

            Settings.ReplaceHistory.Remove(replaceText);
            Settings.ReplaceHistory.Insert(0, replaceText);
            // Limit list to MaxHistoryItems
            if (MaxHistoryItems > 0 && Settings.ReplaceHistory.Count > MaxHistoryItems)
                Settings.ReplaceHistory.RemoveRange(MaxHistoryItems - 1, Settings.ReplaceHistory.Count - MaxHistoryItems);
            return true;
        }