コード例 #1
0
        protected override void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
        {
            base.OnDataSourceReplaced(oldDataSource, newDataSource);

            DestroyUIRepresentation();
            CreateUIRepresentation();
        }
コード例 #2
0
		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;
		}
コード例 #3
0
        protected virtual void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
        {
            if (oldDataSource != null)
            {
                oldDataSource.CollectionChanged -= OnDataSource_CollectionChanged;
            }

            if (newDataSource != null)
            {
                newDataSource.CollectionChanged += OnDataSource_CollectionChanged;
            }
        }
コード例 #4
0
        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);
        }
コード例 #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);
        }
コード例 #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";
                }
            }
        }
コード例 #7
0
		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;
			}
		}
コード例 #8
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;
			}
		}
コード例 #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);
            }
        }
コード例 #10
0
		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;
		}
コード例 #11
0
        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);
            }
        }
コード例 #12
0
        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);
        }
コード例 #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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
 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);
 }
コード例 #17
0
		public override bool TryBuild(object data, out PointDataSourceBase dataSource)
		{
			dataSource = data as PointDataSourceBase;
			return dataSource != null;
		}
コード例 #18
0
 protected void RaiseDataSourceChanged(PointDataSourceBase prevSource, PointDataSourceBase currSource)
 {
     DataSourceChanged.Raise(this, prevSource, currSource);
 }
コード例 #19
0
 public abstract bool TryBuild(object data, out PointDataSourceBase dataSource);
コード例 #20
0
		public abstract bool TryBuild(object data, out PointDataSourceBase dataSource);
コード例 #21
0
 private void RaiseDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
 {
     DataSourceReplaced.Raise(this, prevSource, currSource);
 }