Esempio n. 1
0
        protected override void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
        {
            base.OnDataSourceReplaced(oldDataSource, newDataSource);

            DestroyUIRepresentation();
            CreateUIRepresentation();
        }
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			XmlElement xmlElement = data as XmlElement;
			dataSource = null;
			if (xmlElement != null)
			{
				dataSource = new XmlElementDataSource(xmlElement);
				return true;
			}
			return false;
		}
Esempio n. 3
0
        protected virtual void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
        {
            if (oldDataSource != null)
            {
                oldDataSource.CollectionChanged -= OnDataSource_CollectionChanged;
            }

            if (newDataSource != null)
            {
                newDataSource.CollectionChanged += OnDataSource_CollectionChanged;
            }
        }
        public override bool TryBuild(object data, out PointDataSourceBase dataSource)
        {
            XmlElement xmlElement = data as XmlElement;

            dataSource = null;
            if (xmlElement != null)
            {
                dataSource = new XmlElementDataSource(xmlElement);
                return(true);
            }
            return(false);
        }
Esempio n. 5
0
        protected override void OnDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
        {
            base.OnDataSourceReplaced(prevSource, currSource);

            if (currSource != null)
            {
                MakeStandartPredictions(currSource);
                DrawAllMarkers(true);
            }

            // this is for PieChart in legend.
            //RaiseDataSourceChanged(prevSource, currSource);
        }
Esempio n. 6
0
        private void MakeStandartPredictions(PointDataSourceBase currSource)
        {
            Type dataType = currSource.GetDataType() as Type;

            if (dataType != null)
            {
                if (dataType == typeof(Point) && DependentValuePath == null && IndependentValuePath == null)
                {
                    DependentValuePath   = "Y";
                    IndependentValuePath = "X";
                }
            }
        }
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			dataSource = null;

			IEnumerable<Point> collection = data as IEnumerable<Point>;
			if (collection != null)
			{
				dataSource = new EnumerablePointDataSource(collection);
				return true;
			}
			else
			{
				return false;
			}
		}
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			dataSource = null;

			Point[] array = data as Point[];
			if (array != null)
			{
				dataSource = new PointArrayDataSource(array);
				return true;
			}
			else
			{
				return false;
			}
		}
Esempio n. 9
0
        public override bool TryBuild(object data, out PointDataSourceBase dataSource)
        {
            dataSource = null;

            Point[] array = data as Point[];
            if (array != null)
            {
                dataSource = new PointArrayDataSource(array);
                return(true);
            }
            else
            {
                return(false);
            }
        }
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			dataSource = null;

			var types = IEnumerableHelper.GetGenericInterfaceArgumentTypes(data, typeof(IEnumerable<>));
			if (types != null && types.Length == 1)
			{
				Type genericIEnumerableType = typeof(GenericIEnumerableDataSource<>).MakeGenericType(types);
				var result = Activator.CreateInstance(genericIEnumerableType, data);
				dataSource = (PointDataSourceBase)result;
				return true;
			}

			return false;
		}
        public override bool TryBuild(object data, out PointDataSourceBase dataSource)
        {
            dataSource = null;

            IEnumerable <Point> collection = data as IEnumerable <Point>;

            if (collection != null)
            {
                dataSource = new EnumerablePointDataSource(collection);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override bool TryBuild(object data, out PointDataSourceBase dataSource)
        {
            dataSource = null;

            var types = IEnumerableHelper.GetGenericInterfaceArgumentTypes(data, typeof(IEnumerable <>));

            if (types != null && types.Length == 1)
            {
                Type genericIEnumerableType = typeof(GenericIEnumerableDataSource <>).MakeGenericType(types);
                var  result = Activator.CreateInstance(genericIEnumerableType, data);
                dataSource = (PointDataSourceBase)result;
                return(true);
            }

            return(false);
        }
Esempio n. 13
0
        protected virtual void OnDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
        {
            if (prevSource != null)
            {
                prevSource.CollectionChanged -= OnDataSourceChanged;
                prevSource.DataPrepaired     -= DataSource_OnDataPrepaired;
            }
            if (currSource != null)
            {
                currSource.CollectionChanged += OnDataSourceChanged;
                currSource.DataPrepaired     += DataSource_OnDataPrepaired;

                currSource.Filters.AddMany(filters);
            }

            RaiseDataSourceReplaced(prevSource, currSource);
        }
        public PointDataSourceBase BuildDataSource(object data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            PointDataSourceBase result = null;

            foreach (var factory in factories)
            {
                if (factory.TryBuild(data, out result))
                {
                    return(result);
                }
            }

            return(null);
        }
 public static IEnumerable <Point> GetPoints(this PointDataSourceBase dataSource, DataSourceEnvironment environment)
 {
     return(dataSource.GetData(environment).Cast <object>().Select(o => dataSource.DataToPoint(o)));
 }
 public override bool TryBuild(object data, out PointDataSourceBase dataSource)
 {
     dataSource = data as PointDataSourceBase;
     return(dataSource != null);
 }
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			dataSource = data as PointDataSourceBase;
			return dataSource != null;
		}
 protected void RaiseDataSourceChanged(PointDataSourceBase prevSource, PointDataSourceBase currSource)
 {
     DataSourceChanged.Raise(this, prevSource, currSource);
 }
Esempio n. 19
0
 public abstract bool TryBuild(object data, out PointDataSourceBase dataSource);
		public abstract bool TryBuild(object data, out PointDataSourceBase dataSource);
Esempio n. 21
0
 private void RaiseDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
 {
     DataSourceReplaced.Raise(this, prevSource, currSource);
 }