public static string ProgressString <T>(this BasicList <T> thisList, T thisItem, string miscText)
    {
        int index = thisList.IndexOf(thisItem);

        if (index == -1)
        {
            throw new CustomBasicException("Item Not Found");
        }
        index += 1;
        return($"{ miscText} # {index} of {thisList.Count} on {DateTime.Now}");
    }
Exemple #2
0
        internal int AddObjectKey(object value, out bool existing)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            if ((object)value == (object)rootObject) // (object) here is no-op, but should be
            {                                        // preserved even if this was typed - needs ref-check
                existing = true;
                return(Root);
            }

            string    s;
            BasicList list  = List;
            int       index = ((s = value as string) == null) ? list.IndexOfReference(value) : list.IndexOf(new StringMatch(s));

            if (!(existing = index >= 0))
            {
                index = list.Add(value);
            }
            return(index + 1);
        }