using InABox.Core;
using Org.BouncyCastle.Asn1.X509.Qualified;
using Syncfusion.UI.Xaml.Grid;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace InABox.DynamicGrid;

public interface IDynamicGridSummary
{
}

public class DynamicGridCountSummary : IDynamicGridSummary
{
}

public abstract class DynamicGridSumSummary(string format) : IDynamicGridSummary
{
    public string Format { get; set; } = format;

    public abstract Type AggregateType { get; }
}

public class DynamicGridSumSummary<TAggregate>(string format) : DynamicGridSumSummary(format)
{
    public string Format { get; set; } = format;

    public override Type AggregateType => typeof(TAggregate);
}

public class DynamicGridCustomSummary(DynamicGridCustomSummary.AggregateFunc aggregate, string format) : IDynamicGridSummary
{
    public delegate object AggregateFunc(IEnumerable<CoreRow> rows);

    public AggregateFunc Aggregate { get; set; } = aggregate;

    public string Format { get; set; } = format;
}

public class DynamicGridTemplateSummary(Func<FrameworkElement?> template) : IDynamicGridSummary
{
    public Func<FrameworkElement?> Template { get; set; } = template;
}
