mercredi 13 janvier 2021

AmbiguousMatchException: "Mehrdeutige Übereinstimmung gefunden" on Bindinglistview

I am going crazy on this: I have in information class, which contains some information about software instances in the network. It looks like this:

public class cInstances
{
    public enum eStatus
    {
        UNKNOWN = 0x00,
        TO_BE_UPDATED = 0x01,
        UPDATE_FINISHED = 0x02
    }        

    public string id { get; set; }
    public string AppName { get; set; }
    public string IP { get; set; }
    public string version { get; set; }
    //public string machine { get; set; }
    public eStatus status { get; set; }
    public DateTime? lastAlive { get; set; }
    public DateTime? lastUpdate { get; set; }

    public cInfoHW info_HW { get; set; }
    public List<cInfoHDD> info_HDD { get; set; }

    [JsonIgnore]
    public UDPconnection connection { get; set; }

    public cInstances()
    {
        try
        {
            info_HW = new cInfoHW();
            info_HDD = new List<cInfoHDD>();
        }
        catch (Exception ex)
        {
            Log log = new Log(null, null);
            log.Write(LogLevel.LOG_ERROR, ex.ToString());
        }
    }        
}

Now in my program I want to make this data visible in a Data grid and decided to use Equin BindinglistView.

global = AppData.GetInstance();
public BindingListView<cInstances> BiLiVi;
BiLiVi = new BindingListView<cInstances>(global.Instances);
dgv_data.DataSource = BiLiVi;

Here occurs the exception: On new BindingListView(...) I receive a AmbiguousMatchException: "Mehrdeutige Übereinstimmung gefunden." When I remove the getter and setter methods in the following line, it works fine. But I do really need them!

public List<cInfoHDD> info_HDD { get; set; }

Here is the HDD info class:

public class cInfoHDD
{
    public string Name { get; set; }
    public string DriveFormat { get; set; }
    public string AvailableFreeSpace { get; set; }
    public string TotalFreeSpace { get; set; }
    public string TotalSize { get; set; }
    public DateTime timestamp { get; set; }
    public cInfoHDD()
    {
        timestamp = DateTime.Now;
    }
}

Please help me. I do not see, where I am going wrong. Thank you, Lama





Aucun commentaire:

Enregistrer un commentaire