ChronopicRegisterPortList.UpdatePort C# (CSharp) Method

UpdatePort() public method

public UpdatePort ( ChronopicRegisterPort, crp, string newPort ) : void
crp ChronopicRegisterPort,
newPort string
return void
    public void UpdatePort(ChronopicRegisterPort crp, string newPort)
    {
        foreach(ChronopicRegisterPort c in L) {
            if(c.SerialNumber == crp.SerialNumber) {
                c.Port = newPort;
                break;
            }
        }
    }

Usage Example

Esempio n. 1
0
    protected void registerAddOrUpdate(ChronopicRegisterPort crp)
    {
        if (!crp.FTDI)
        {
            return;
        }

        if (!crpl.Exists(crp))
        {
            crpl.Add(crp);
        }
        else if (crpl.PortChanged(crp))
        {
            crpl.UpdatePort(crp, crp.Port);
        }
    }