public static bool TryGetCommTypeDataByCode(uint code, out CommTypeData commTypeData) { CommTypeData[] matches = commTypes.Where(x => x.code == code).ToArray(); if (matches.Length == 0) { commTypeData = default; return(false); } else { commTypeData = matches[0]; return(true); } }
public static bool TryGetCommTypeDataByCommInstance(Comm comm, out CommTypeData commTypeData) { CommTypeData[] matches = commTypes.Where(x => comm.GetType() == x.type).ToArray(); if (matches.Length == 0) { commTypeData = default; return(false); } else { commTypeData = matches[0]; return(true); } }