Nanook.QueenBee.EditorForm.getValueForList C# (CSharp) Method

getValueForList() private method

private getValueForList ( QbItemBase itm ) : string
itm Nanook.QueenBee.Parser.QbItemBase
return string
        private string getValueForList(QbItemBase itm)
        {
            int max = 100;
            StringBuilder sb = new StringBuilder(max);

            if (itm is QbItemInteger)
            {
                foreach (uint i in ((QbItemInteger)itm).Values)
                {
                    if (sb.Length != 0)
                        sb.Append(", ");
                    sb.Append(((int)i).ToString()); //default to ease for this quick list
                    if (sb.Length > max)
                        break;
                }
            }
            else if (itm is QbItemFloat)
            {
                foreach (float f in ((QbItemFloat)itm).Values)
                {
                    if (sb.Length != 0)
                        sb.Append(", ");
                    sb.Append(f.ToString());
                    if (sb.Length > max)
                        break;
                }
            }
            else if (itm is QbItemFloats)
            {
                foreach (float f in ((QbItemFloats)itm).Values)
                {
                    if (sb.Length != 0)
                        sb.Append(", ");
                    sb.Append(f.ToString());
                    if (sb.Length > max)
                        break;
                }
            }
            else if (itm is QbItemQbKey)
            {
                foreach (QbKey qb in ((QbItemQbKey)itm).Values)
                {
                    if (sb.Length != 0)
                        sb.Append(", ");
                    if (qb.Text.Length != 0)
                        sb.Append(qb.Text);
                    else
                        sb.Append(qb.Crc.ToString("X").PadLeft(8, '0'));
                    if (sb.Length > max)
                        break;
                }
            }
            else if (itm is QbItemString)
            {
                foreach (string s in ((QbItemString)itm).Strings)
                {
                    if (sb.Length != 0)
                        sb.Append(", ");
                    sb.Append(s);
                    if (sb.Length > max)
                        break;
                }
            }

            string str = sb.ToString();
            if (str.Length > max)
                return string.Concat(str.Substring(0, max), "...");
            else
                return str;
        }
EditorForm