/// <summary>
        /// Gets name of tone and add it to Tones list at once.
        /// </summary>
        /// <param name="arrTone"></param>
        /// <param name="it"></param>
        /// <returns></returns>
        private string GetToneName(string arrTone, List <Tone2014> it)
        {
            string       ToneName = "";
            const string Default  = "Default";

            if (!String.IsNullOrEmpty(arrTone))
            {
                // recognize that ToneBase name alpha case mismatches do exist and process it
                // take the first if there are multiple matches so error is not thrown
                var matchedTone = it.FirstOrDefault(t => t.Name.ToLower() == arrTone.ToLower());
                if (ReferenceEquals(matchedTone, null))
                {
                    return(ToneName);
                }

                if (matchedTone.GearList.IsNull())
                {
                    ToneName = Default;
                }
                else
                {
                    if (!Tones.Contains(matchedTone))
                    {
                        Tones.Add(matchedTone);
                    }
                    ToneName = arrTone;
                }
            }
            return(ToneName);
        }
예제 #2
0
        /// <summary>
        /// Gets name of tone and add it to Tones list at once.
        /// </summary>
        /// <param name="arrTone"></param>
        /// <param name="it"></param>
        /// <returns></returns>
        private string GetToneName(string arrTone, List <Tone2014> it)
        {
            string       ToneName = "";
            const string Default  = "Default";

            if (!String.IsNullOrEmpty(arrTone))
            {
                var matchedTone = it.SingleOrDefault(t => t.Name == arrTone);
                if (ReferenceEquals(matchedTone, null))
                {
                    return(ToneName);
                }

                if (matchedTone.GearList.IsNull())
                {
                    ToneName = Default;
                }
                else
                {
                    if (!Tones.Contains(matchedTone))
                    {
                        Tones.Add(matchedTone);
                    }
                    ToneName = arrTone;
                }
            }
            return(ToneName);
        }