Foobricator.Tools.DataReference.ToString C# (CSharp) Method

ToString() public method

Dereferences and tries to get a string value. See Details.
public ToString ( string format, IFormatProvider formatProvider ) : string
format string
formatProvider IFormatProvider
return string
        public string ToString(string format, IFormatProvider formatProvider)
        {
            object value = Dereference();

            if (value == null)
            {
                return string.Empty;
            }

            if (value is ISource)
            {
                value = ((ISource)value).GetItem();
            }

            return value is IFormattable
                    ? ((IFormattable)value).ToString(format, formatProvider)
                    : value.ToString();
        }