コード例 #1
0
            public static GenericBinding FindBinding(int index, List <GenericBinding> genericBindings)
            {
                int parts = 0;

                for (int i = 0; i < genericBindings.Count; i++)
                {
                    GenericBinding b = genericBindings[i];
                    parts += b.attribute == 1 || b.attribute == 3 ? 3 : 4;
                    if (parts > index)
                    {
                        return(b);
                    }
                }

                return(null);
            }
コード例 #2
0
        public GenericBinding FindBinding(int index)
        {
            int curves = 0;

            for (int i = 0; i < genericBindings.Count; i++)
            {
                GenericBinding b = genericBindings[i];
                curves += b.attribute == 2 ? 4 : b.attribute <= 4 ? 3 : 1;
                if (curves > index)
                {
                    return(b);
                }
            }

            return(null);
        }