Newer
Older
Correlator / PipeGallery / Model / ChartBase.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace PipeGallery.Model
{

    [Serializable]
    public class ChartBase : INotifyPropertyChanged
    {
        private string _id = string.Empty;
        //GUID
        public string ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = string.Empty;

        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private ControlType _dataControl;
        //数据源控件类型(如:曲线\柱状\K线等)
        public ControlType DataControl
        {
            get { return _dataControl; }
            set { _dataControl = value; }
        }

        private ChartType _chartType;
       
        public ChartType ChartType
        {
            get { return _chartType; }
            set { _chartType = value; }
        }

        private string _color = "#319724";
        //颜色
        public string Color
        {
            get { return _color; }
            set { _color = value; }
        }


        private CoordinatesInfoType _coordinates;

        public CoordinatesInfoType Coordinates
        {
            get { return _coordinates; }
            set { _coordinates = value; }
        }

        public void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));

            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public virtual double GetMaxValue()
        {
            return 0;
        }

        public virtual double GetMinValue()
        {
            return 0;
        }

        public virtual List<DateTime> GetDateTimeList()
        {
            return new List<DateTime>();
        }

        public virtual void DrawGeometricFigure(Canvas canvas, double maxy, double miny, CoordinatesInfoType coordinates)
        {

        }

        public virtual void RefreshGeometricFigure()
        {

        }
    }
}