public static IEnumerable<Point> GetPoints(IPointDataSource dataSource, DependencyObject context)
        {
            if (dataSource == null)
                throw new ArgumentNullException("dataSource");

            if (context == null)
                context = Context.EmptyContext;

            using (IPointEnumerator enumerator = dataSource.GetEnumerator(context))
            {
                Point p = new Point();
                while (enumerator.MoveNext())
                {
                    enumerator.GetCurrent(ref p);
                    yield return p;
                    p = new Point();
                }
            }
        }
Esempio n. 2
0
        public static IEnumerable <Point> GetPoints(IPointDataSource dataSource, DependencyObject context)
        {
            if (dataSource == null)
            {
                throw new ArgumentNullException("dataSource");
            }

            if (context == null)
            {
                context = Context.EmptyContext;
            }

            using (IPointEnumerator enumerator = dataSource.GetEnumerator(context))
            {
                Point p = new Point();
                while (enumerator.MoveNext())
                {
                    enumerator.GetCurrent(ref p);
                    yield return(p);

                    p = new Point();
                }
            }
        }
Esempio n. 3
0
        public static IEnumerable <Point> GetPoints(IPointDataSource dataSource, DependencyObject context)
        {
            if (dataSource == null)
            {
                yield break;
            }

            if (context == null)
            {
                context = new DataSource2dContext();
            }

            using (IPointEnumerator enumerator = dataSource.GetEnumerator(context))
            {
                Point p = new Point();
                while (enumerator.MoveNext())
                {
                    enumerator.GetCurrent(ref p);
                    yield return(p);

                    p = new Point();
                }
            }
        }