ACAT.Lib.Core.AbbreviationsManagement.Abbreviations.Add C# (CSharp) Method

Add() public method

Adds the abbreviation object to the list. If it already exists, it is replaced.
public Add ( ACAT.Lib.Core.AbbreviationsManagement.Abbreviation abbreviation ) : bool
abbreviation ACAT.Lib.Core.AbbreviationsManagement.Abbreviation Abbreviation to add
return bool
        public bool Add(Abbreviation abbreviation)
        {
            if (String.IsNullOrEmpty(abbreviation.Mnemonic) ||
                String.IsNullOrWhiteSpace(abbreviation.Mnemonic) ||
                String.IsNullOrWhiteSpace(abbreviation.Expansion) ||
                String.IsNullOrEmpty(abbreviation.Expansion))
            {
                return false;
            }

            _abbreviationList[abbreviation.Mnemonic] = abbreviation;
            return true;
        }