コード例 #1
0
        public PositionedControlComponent(Component parent, CurveComponent curveComponent) : base(parent)
        {
            if (curveComponent == null)
            {
                throw new ArgumentNullException("curveComponent");
            }

            this.curveComponent = curveComponent;
        }
コード例 #2
0
ファイル: RootComponent.cs プロジェクト: julianbrunner/kurve
        void AddCurve(CurveComponent curveComponent)
        {
            curveComponent.RemoveCurve += delegate()
            {
                curveComponents.Remove(curveComponent);

                Changed();
            };

            curveComponents.Add(curveComponent);
        }
コード例 #3
0
        public SegmentComponent(Component parent, CurveComponent curveComponent, PositionedControlComponent leftComponent, PositionedControlComponent rightComponent) : base(parent, curveComponent)
        {
            if (leftComponent == null)
            {
                throw new ArgumentNullException("leftComponent");
            }
            if (rightComponent == null)
            {
                throw new ArgumentNullException("rightComponent");
            }

            this.leftComponent  = leftComponent;
            this.rightComponent = rightComponent;
        }
コード例 #4
0
        public SpecificationComponent(Component parent, CurveComponent curveComponent, double position, IEnumerable <CurveSpecification> specifications) : base(parent, curveComponent)
        {
            if (!new OrderedRange <double>(0, 1).Contains(position))
            {
                throw new ArgumentOutOfRangeException();
            }
            if (specifications == null)
            {
                throw new ArgumentNullException("specifications");
            }
            if (specifications.OfType <PointCurveSpecification>().Count() > 1)
            {
                throw new ArgumentException("There may not be more than one PointCurveSpecification at one position.");
            }
            if (specifications.OfType <DirectionCurveSpecification>().Count() > 1)
            {
                throw new ArgumentException("There may not be more than one DirectionCurveSpecification at one position.");
            }
            if (specifications.OfType <CurvatureCurveSpecification>().Count() > 1)
            {
                throw new ArgumentException("There may not be more than one CurvatureCurveSpecification at one position.");
            }

            this.position = position;

            if (specifications.OfType <PointCurveSpecification>().Count() == 1)
            {
                this.specifiesPoint = true;
                this.point          = specifications.OfType <PointCurveSpecification>().Single().Point;
            }
            if (specifications.OfType <DirectionCurveSpecification>().Count() == 1)
            {
                this.specifiesDirection = true;
                this.direction          = specifications.OfType <DirectionCurveSpecification>().Single().Direction;
            }
            if (specifications.OfType <CurvatureCurveSpecification>().Count() == 1)
            {
                this.specifiesCurvature = true;
                this.curvature          = specifications.OfType <CurvatureCurveSpecification>().Single().Curvature;
            }
        }
コード例 #5
0
 public FixedPositionComponent(Component parent, CurveComponent curveComponent, double position) : base(parent, curveComponent)
 {
     this.position = position;
 }