Пример #1
0
        public double GetValue(DataValueSourceEnum valueSource)
        {
            if (HasDataValues == false)
            {
                return(double.NaN);
            }

            switch (valueSource)
            {
            case DataValueSourceEnum.High:
                return(this.High);

            case DataValueSourceEnum.Low:
                return(this.Low);

            case DataValueSourceEnum.Average:
                return(this.Average);

            case DataValueSourceEnum.Open:
                return(this.Open);

            case DataValueSourceEnum.Volume:
                return(this.Volume);

            case DataValueSourceEnum.Close:
                return(this.Close);

            default:
                System.Diagnostics.Debug.Fail("Unexpected case.");
                break;
            }
            return(0);
        }
        public double GetValue(DataValueSourceEnum valueSource)
        {
            if (HasDataValues == false)
            {
                return double.NaN;
            }

            switch (valueSource)
            {
                case DataValueSourceEnum.High:
                    return this.High;
                case DataValueSourceEnum.Low:
                    return this.Low;
                case DataValueSourceEnum.Average:
                    return this.Average;
                case DataValueSourceEnum.Open:
                    return this.Open;
                case DataValueSourceEnum.Volume:
                    return this.Volume;
                case DataValueSourceEnum.Close:
                    return this.Close;
                default:
                    System.Diagnostics.Debug.Fail("Unexpected case.");
                    break;
            }
            return 0;
        }