Exemple #1
0
        public Port GetPort(int id, NodeTypeInfo.IOMode mode)
        {
            var list = this.Query <Port>().ToList();

            foreach (var item in list)
            {
                var info = (NodeTypeInfo.IOInfo)item.source;
                if (info != null && info.ID == id && info.Mode == mode)
                {
                    return(item);
                }
            }
            return(null);
        }
        public static bool Match(this NodeTypeInfo.IOMode a, NodeTypeInfo.IOMode b)
        {
            var av = (int)a >> 6;
            var bm = (int)b & (int)NodeTypeInfo.IOMode.Mask;

            if ((av & bm) == av)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }