예제 #1
0
        public void ValidateFormatList(string[] formats)
        {
            // check combo box
            foreach (var item in formats)
            {
                if (!FormatList.Contains(item))
                {
                    FormatList.Add(item);
                }
            }

            // remove blank
            for (int i = 0; i < FormatList.Count; i++)
            {
                if (String.IsNullOrWhiteSpace(FormatList[i]))
                {
                    FormatList.RemoveAt(i);
                    --i;
                }
            }

            // trim the list
            while (FormatList.Count > Properties.Settings.Default.FormatListCount)
            {
                FormatList.RemoveAt(0);
            }
        }