Example #1
0
        public void SelectPoint(GraphPoint point)
        {
            int index = Points.IndexOf(point);

            if (index >= 0 && index < Points.Count)
            {
                RowManager.CurrentRowIndex = index;
                RowManager.EnsureRowindexVisible(index);
            }
        }
Example #2
0
        public bool DeletePoint(GraphPoint p)
        {
            if (p == null)
            {
                return(false);
            }

            if (Points.Remove(p))
            {
                RowManager.RowCount = Points.Count;
                return(true);
            }

            return(false);
        }
Example #3
0
        public virtual GraphPoint FindPointByKey(string key, GraphList graphlist)
        {
            if (graphlist == null)
            {
                return(null);
            }

            GraphPoint p = null;

            foreach (GraphBase g in graphlist.Values)
            {
                p = g.GetPointByKey(key);
                if (p != null)
                {
                    return(p);
                }
            }

            return(null);
        }
Example #4
0
        public IEnumerable <GraphPoint> FindPoint(decimal x1, decimal y1, decimal x2, decimal y2)
        {
            //if (Points.Count == 0)

            int index = Points.IndexOfElementOrSuccessor(new GraphPoint(x1, y1));

            while (index >= 0 && index < Points.Count)
            {
                GraphPoint p = Points [index];
                if (p.X > x2)
                {
                    yield break;
                }

                if (p.Y >= y1 && p.Y <= y2)
                {
                    yield return(p);
                }

                index++;
            }
        }
Example #5
0
        public bool AddPoint(GraphPoint p)
        {
            if (p == null)
            {
                return(false);
            }

            // check if a point with the same X-Value exists
            int index = Points.IndexOfElementOrSuccessor(p);

            if (index >= 0 && index < Points.Count)
            {
                GraphPoint pp = Points [index];
                if ((double)Math.Abs(pp.X - p.X) < Double.Epsilon)
                {
                    return(false);
                }
            }

            Points.Add(p);
            RowManager.RowCount        = Points.Count;
            RowManager.CurrentRowIndex = Points.IndexOf(p);
            return(true);
        }