コード例 #1
0
                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);
                    }
                }
コード例 #2
0
                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);
                    }
                }