/// <summary> /// Returns the DaisyLink instance for a given DaisyLink compatible socket. /// If this is the first call to this method for a given socket, it creates a new DaisyLink instance, /// which causes the chain to be initialised using the DaisyLink protocol. /// </summary> /// <param name="socket">The socket where the DaisyLink chain of modules is plugged in.</param> /// <param name="module">The daisylink module.</param> /// <returns>The DaisyLink instance for that socket</returns> public static DaisyLink GetDaisyLinkForSocket(Socket socket, DaisyLinkModule module) { lock (portLock) { for (int i = 0; i < daisyLinkList.Count; i++) { if (((DaisyLink)daisyLinkList[i]).Socket == socket) { return((DaisyLink)daisyLinkList[i]); } } DaisyLink daisylink; daisylink = new DaisyLink(socket, module); daisyLinkList.Add(daisylink); daisylink.Initialize(); return(daisylink); } }
/// <summary> /// Returns the DaisyLink instance for a given DaisyLink compatible socket. /// If this is the first call to this method for a given socket, it creates a new DaisyLink instance, /// which causes the chain to be initialised using the DaisyLink protocol. /// </summary> /// <param name="socket">The socket where the DaisyLink chain of modules is plugged in.</param> /// <param name="module">The daisylink module.</param> /// <returns>The DaisyLink instance for that socket</returns> public static DaisyLink GetDaisyLinkForSocket(Socket socket, DaisyLinkModule module) { lock (portLock) { foreach (DaisyLink dl in daisyLinkList) { if (dl.Socket == socket) { return(dl); } } DaisyLink daisylink; daisylink = new DaisyLink(socket, module); daisyLinkList.Add(daisylink); daisylink.Initialize(); return(daisylink); } }
/// <summary> /// Returns the DaisyLink instance for a given DaisyLink compatible socket. /// If this is the first call to this method for a given socket, it creates a new DaisyLink instance, /// which causes the chain to be initialised using the DaisyLink protocol. /// </summary> /// <param name="socket">The socket where the DaisyLink chain of modules is plugged in.</param> /// <param name="module">The daisylink module.</param> /// <returns>The DaisyLink instance for that socket</returns> public static DaisyLink GetDaisyLinkForSocket(Socket socket, DaisyLinkModule module) { lock (portLock) { for (int i = 0; i < daisyLinkList.Count; i++) { if (((DaisyLink)daisyLinkList[i]).Socket == socket) return (DaisyLink)daisyLinkList[i]; } DaisyLink daisylink; daisylink = new DaisyLink(socket, module); daisyLinkList.Add(daisylink); daisylink.Initialize(); return daisylink; } }
/// <summary> /// Returns the DaisyLink instance for a given DaisyLink compatible socket. /// If this is the first call to this method for a given socket, it creates a new DaisyLink instance, /// which causes the chain to be initialised using the DaisyLink protocol. /// </summary> /// <param name="socket">The socket where the DaisyLink chain of modules is plugged in.</param> /// <param name="module">The daisylink module.</param> /// <returns>The DaisyLink instance for that socket</returns> public static DaisyLink GetDaisyLinkForSocket(Socket socket, DaisyLinkModule module) { lock (portLock) { foreach (DaisyLink dl in daisyLinkList) { if (dl.Socket == socket) { return dl; } } DaisyLink daisylink; daisylink = new DaisyLink(socket, module); daisyLinkList.Add(daisylink); daisylink.Initialize(); return daisylink; } }