Example #1
0
    public bool Process(object?instance, Type instanceType, IObjectDumperResultBuilder builder, int indent, int currentDepth)
    {
        if (instance is DateTime dt)
        {
            builder.AddSingleValue(dt.ToString("yyyy-MM-dd HH:mm:ss"), instance.GetType());

            return(true);
        }

        return(false);
    }
Example #2
0
    public bool Process(object?instance, Type instanceType, IObjectDumperResultBuilder builder, int indent, int currentDepth)
    {
        if (instance is string)
        {
            builder.AddSingleValue(instance.ToString(), instance.GetType());

            return(true);
        }

        return(false);
    }
Example #3
0
    public bool Process(object?instance, Type instanceType, IObjectDumperResultBuilder builder, int indent, int currentDepth)
    {
        if (instance == null)
        {
            builder.AddSingleValue(instance, instanceType);

            return(true);
        }

        return(false);
    }
    public bool Process(object?instance, Type instanceType, IObjectDumperResultBuilder builder, int indent, int currentDepth)
    {
        if (instance == null)
        {
            return(false);
        }

        var type = instance.GetType();

        if (type.IsPrimitive || type.IsEnum)
        {
            builder.AddSingleValue(instance, instance.GetType());

            return(true);
        }

        return(false);
    }