コード例 #1
0
ファイル: RangeWithStep.cs プロジェクト: hstde/Calc2
            public StructRangeWithStepEnumerator(RangeWithStep range)
            {
                this.range = range;
                Current    = range.Start - range.Step;

                if (range.Inclusive)
                {
                    if (range.Step > 0)
                    {
                        compare = (a, b) => a <= b;
                    }
                    else
                    {
                        compare = (a, b) => a >= b;
                    }
                }
                else
                {
                    if (range.Step > 0)
                    {
                        compare = (a, b) => a < b;
                    }
                    else
                    {
                        compare = (a, b) => a > b;
                    }
                }
            }
コード例 #2
0
ファイル: RangeWithStep.cs プロジェクト: hstde/Calc2
 public bool Equals(RangeWithStep other)
 {
     return(other.Start == Start && other.End == End && other.Step == Step);
 }